C
caroh
Can anyone see whats wrong with this code:
The connections are remaining live in the database: and causing
"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool" errors.
Try
'open the connection
myConnection.Open()
'run the query
myCommand.ExecuteNonQuery()
Catch ex As SqlException
Finally
'close connection
myConnection.Close()
End Try
'Check to see if the service is restricted
If
myCommand.Parameters("@AccessRestrictionsSupported").Value.Equals(1)
Then
Return True 'service is restricted
'myConnection.Close()
Else
Return False 'service not restricted
'myConnection.Close()
End If
myConnection.Close()
Any help/suggestions very much appreciated
Thanks!!
The connections are remaining live in the database: and causing
"Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool" errors.
Try
'open the connection
myConnection.Open()
'run the query
myCommand.ExecuteNonQuery()
Catch ex As SqlException
Finally
'close connection
myConnection.Close()
End Try
'Check to see if the service is restricted
If
myCommand.Parameters("@AccessRestrictionsSupported").Value.Equals(1)
Then
Return True 'service is restricted
'myConnection.Close()
Else
Return False 'service not restricted
'myConnection.Close()
End If
myConnection.Close()
Any help/suggestions very much appreciated
Thanks!!