Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net. When Should "Using" be Used 1

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
VB.Net. This may be a stupid and too broad of a question. When should I be using the "Using" statement and how do I know it's available to use?

Auguy
Sylvania/Toledo Ohio
 
From MSDN:

"Sometimes your code requires an unmanaged resource, such as a file handle, a COM wrapper, or a SQL connection. A Using block guarantees the disposal of one or more such resources when your code is finished with them. This makes them available for other code to use."




I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thanks Jeb for the link, I think I was at that site before. Do you know if there a suggested list of "Items" where "Using" should be used? Or, is there a way to determine if a statement is a candidate for "Using"?

Auguy
Sylvania/Toledo Ohio
 
Thanks


Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top