I am trying to connect to a SQL server on a PPC using wireless. Most times the wireless is connect and the program connects to the db happily.
On certain occasions it fails and I get error message Server does not exist.
I tried to catch the connection.open command
connDB = New SqlConnection(sconn)
cmndDB = New SqlCommand(sSQL, connDB)
ConnectionAttempt:
Try
connDB.Open()
drDetails = cmndDB.ExecuteReader()
Catch exSQL As SqlException
Dim errSQL As SqlError
'
For Each errSQL In exSQL.Errors
ListBox1.Items.Add("SQL Exception - " & exSQL.Message & " " & exSQL.Number)
If exSQL.Number = 17 Then
GoTo ConnectionAttempt
End If
Next
Finally
If connDB.State = ConnectionState.Open Then connDB.Close()
End Try
Can anyone help with the connection loop.
Thanks
On certain occasions it fails and I get error message Server does not exist.
I tried to catch the connection.open command
connDB = New SqlConnection(sconn)
cmndDB = New SqlCommand(sSQL, connDB)
ConnectionAttempt:
Try
connDB.Open()
drDetails = cmndDB.ExecuteReader()
Catch exSQL As SqlException
Dim errSQL As SqlError
'
For Each errSQL In exSQL.Errors
ListBox1.Items.Add("SQL Exception - " & exSQL.Message & " " & exSQL.Number)
If exSQL.Number = 17 Then
GoTo ConnectionAttempt
End If
Next
Finally
If connDB.State = ConnectionState.Open Then connDB.Close()
End Try
Can anyone help with the connection loop.
Thanks