I have these variable:
vb Code:
Public Shared SQLConn As SqlClient.SqlConnection
It use for doing ADO.NET connection. So, after I finished database processing, I close and re-use that variable. Is it wise? Which are better than I use this on every ADO.NET transaction?
vb Code:
Using MyConn As New SqlClient.SqlConnection 'DB processing here End Using
Since I heard that Garbage Collector won't remove an object immediately, I thought an idea about using a single object repeatedly than create and dispose an object each processing.
Regards,
Michael




Reply With Quote