Thanks for the tip. BTW, is there a construct in VB similar to the C#
"using" keyword, that I could use with the SqlDataReader?
Thanks again
"Samuel R. Neff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> If you control the objec, then you should dispose all IDisposable
> objects. Control usually means if you created it, but that's not
> always the case.
>
> Dispose calls Close so you don't need to call both. Just call
> Dispose.
>
> Besides being good practice, Dispose also usually triggers
> GC.SuppressFinalize() and will actually improve the garbage collector
> performance since the finalizer no longer has to be called (not always
> the case, but is the norm for Dispose implementations).
>
> HTH,
>
> Sam
>
>
> On Wed, 16 Mar 2005 13:02:36 -0500, "Michael C#" <(E-Mail Removed)>
> wrote:
>
>>The System.Data.SqlClient.SqlConnection has Close() and Dispose() methods.
>>So I started using Dispose() on my SqlConnections after I Close() them.
>>I've started getting into the habit of calling Dispose() on every object
>>that has a Dispose() method on it, after I'm through with it. I was just
>>wondering if it's safe to assume that if an object has a Dispose() method
>>you should always call it when done with it? Or am I just making more
>>busy-work for myself and having no effect on anything really?
>>
>
> B-Line is now hiring one Washington D.C. area VB.NET
> developer for WinForms + WebServices position.
> Seaking mid to senior level developer. For
> information or to apply e-mail resume to
> sam_blinex_com.
|