Hi, my name is Dave, and I'm a user. ("Hi Dave!") All's I know is since I changed most of my code to Using, my DB has never been happier and my active connection count has dropped.
Using conn As New SqlConnection([global].ConnectionString)
conn.Open()
dim sqlstring as string="Your Sql String"
Using mycommand As New SqlCommand(sqlstring, conn)
Using dr As SqlDataReader = mycommand.ExecuteReader
While dr.Read = True
blah blah blah
end while
end using
end using
I just might end using "using" in place of dim. so memory is released as soon as you're done "using" a variable... right?