question about using connection

E

Eric

Hi,

i use this for a database connection:

Using mConnection As New SqlConnection(param.ConnectionString)
mConnection.Open()
sql = "insert ...."
comd = New SqlCommand(sql, mConnection)
comd.ExecuteNonQuery()
End Using

My question is: do i need to close the connection with: mConnection.Close()
or does the End Using do itself?

thanks
Eric
 
A

Andy B.

The end using statement closes it. If you don't use the using statement you
would have to close it yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top