No, you do not need to explicitly call Close if you are using a block Using. Here is how I wrote it:
Using conn As New SqlConnection("SOME CONNECTION STRING")
Using cmd = conn.CreateCommand()
conn.Open()
cmd.CommandText = "some sql command here"
' ... create and fill data table
End Using
End Using
Also, the call Closedoes not close the connection. ADO.NET uses a connection pool, so calling Close simply returns a connection to the pool. This does not physically close the connection.
source
share