Sql – Does End Using close an open SQL Connection


If I wrap a SQLConnection in a Using, should I close it or does the end using handle it?

using cn as new system.data.sqlclient.sqlconnection()
    '{do a bunch of other stuff with commands and datareaders here}
    cn.close 'Do I need this?
end using 

Best Solution

Exiting a using block calls .Dispose() on the object in question (cn in your example) which for a SqlConnection will close the connection and any open resources.