closing connection
closing connection
(OP)
question....
is con.close() enough to close the connection ? or should I also add con.dispose() ?
I have been getting a message stating "Timeout expired. the timeout period elapsed prior to a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
any info would be appreciated
is con.close() enough to close the connection ? or should I also add con.dispose() ?
I have been getting a message stating "Timeout expired. the timeout period elapsed prior to a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
any info would be appreciated
RE: closing connection
RE: closing connection
Using con As SqlConnection = New SqlConnection(My_Con)
Dim cmd As New SqlCommand
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "My SP"
Try
con.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
error handling
Finally
message to user
End Try
End If
End Using
RE: closing connection
CODE
Borislav Borissov
VFP9 SP2, SQL Server
RE: closing connection
I thought of the whole purpose of "using" was that the connection was closed automatically and you don't need to do a con.close() ? I guess it wouldn't hurt
RE: closing connection