New Message on dotNET User Group Hyd

Need Help on Using

Reply
  Reply to Sender   Recommend Message 3 in Discussion
From: Vishnu-Chivukula

Hi Vijay,
 
           Using statement basically defines the scope of the object created and at the end of which the object is disposed.
 
          When you create an object that binds itself to a resource, typically like a database connection or file handle, you have to make sure that you call the dispose method of that object when you are done with it. This is typically done in the finally block, which always gets executed.
 
          C# language provides using statement, which does the same implicitly. At the end of the object's scope, the dispose method is called automatically. This is typically used for objects whose life time is short and does not exists beyond that method like your database connection, comand object....
 
          If your code throws an exception and leaves the block, the object will be automatically destroyed as its scope is over. The runtime guarentees this.
 
Need any help, do post a msg back.
 
 
Happy coding.

View other groups in this category.

Click here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to