G
Guest
Hi
I've just lost the whole message so this time short:
1. Develped using VS 2005 and CF 2.0
2. Pocket PC runs Windows Mobile 5.0 and connectes to LAN via WiFi
3. Can ping SQL server using vx Util
4. Connection string copied from the desktop app and it works
5. CF framework and SQL Server Client 2.0 installed on the pocket PC
6. Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn = New System.Data.SqlClient.SqlConnection("Data Source=" +
txtServer.Text + ";Initial Catalog=PVI;user id=" + txtUID.Text + ";pwd=" +
txtPWD.Text)
Try
cn.Open()
Label1.Text = "Connected"
Catch ex As Data.SqlClient.SqlException
Dim errorMessages As String = ""
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
errorMessages += "Index #" & i.ToString() &
ControlChars.NewLine _
& "Message: " & ex.Errors(i).Message &
ControlChars.NewLine _
& "LineNumber: " & ex.Errors(i).LineNumber &
ControlChars.NewLine _
& "Source: " & ex.Errors(i).Source &
ControlChars.NewLine _
& "Procedure: " & ex.Errors(i).Procedure &
ControlChars.NewLine
Next i
MsgBox("Could Not Connect" + vbCrLf + errorMessages)
Finally
cn.Close()
End Try
End Sub
Any ideas on how to troblehooot this
I've just lost the whole message so this time short:
1. Develped using VS 2005 and CF 2.0
2. Pocket PC runs Windows Mobile 5.0 and connectes to LAN via WiFi
3. Can ping SQL server using vx Util
4. Connection string copied from the desktop app and it works
5. CF framework and SQL Server Client 2.0 installed on the pocket PC
6. Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn = New System.Data.SqlClient.SqlConnection("Data Source=" +
txtServer.Text + ";Initial Catalog=PVI;user id=" + txtUID.Text + ";pwd=" +
txtPWD.Text)
Try
cn.Open()
Label1.Text = "Connected"
Catch ex As Data.SqlClient.SqlException
Dim errorMessages As String = ""
Dim i As Integer
For i = 0 To ex.Errors.Count - 1
errorMessages += "Index #" & i.ToString() &
ControlChars.NewLine _
& "Message: " & ex.Errors(i).Message &
ControlChars.NewLine _
& "LineNumber: " & ex.Errors(i).LineNumber &
ControlChars.NewLine _
& "Source: " & ex.Errors(i).Source &
ControlChars.NewLine _
& "Procedure: " & ex.Errors(i).Procedure &
ControlChars.NewLine
Next i
MsgBox("Could Not Connect" + vbCrLf + errorMessages)
Finally
cn.Close()
End Try
End Sub
Any ideas on how to troblehooot this