April 14, 2005 at 7:28 am
Right, I had created a nice working PDA application which worked with on my old computer fine before it blow up. Need to get the the mobile vb.net application connecting again on my new laptop running sql server 2000. Everything settings on the old machine I've tried to match on the laptop.
Been trying to deploy the vb.net app again, but I'm getting a SQL exception, it comes up with:
Index #0
Message: General network error. Check your network documentation
LineNumber:0
Source: .Net SqlClient Data provider
Procedure: ConnectionRead (rec))).
The code I'm using is:
txtConnString.Text = "server=BRENDEN;database=Pubs;user id=connect;password=connect;"
Dim cnnPubs As SqlConnection
Try
cnnPubs = New SqlConnection
cnnPubs.ConnectionString = txtConnString.Text
cnnPubs.Open()
MsgBox("Test connection succeeded.", MsgBoxStyle.Information)
Catch e As SqlException
Dim errorMessages As String
Dim i As Integer
For i = 0 To e.Errors.Count - 1
errorMessages += "Index #" & i.ToString() & ControlChars.NewLine _
& "Message: " & e.Errors(i).Message & ControlChars.NewLine _
& "LineNumber: " & e.Errors(i).LineNumber & ControlChars.NewLine _
& "Source: " & e.Errors(i).Source & ControlChars.NewLine _
& "Procedure: " & e.Errors(i).Procedure & ControlChars.NewLine
MsgBox(errorMessages, MsgBoxStyle.Exclamation)
Next i
Finally
cnnPubs.Close()
End Try
The problem gets worse, I wrote a normal vb.net application using the same code and connection string, and it works! So I think it's a setting in SQL Server to allow a user via a PDA. The user "connect" has been created in sql server and has the correct permissions. Make sure they have access to the database, and have the public and db_owner setting checked as well.
I' have no idea of what it could be
Any Ideas! Thanks in advance.
Brenden
April 14, 2005 at 8:36 am
I'm running xp pro with sp2, not sure could it block the connection to the sql server? I haven't applied any service packs, but going to try adding 3a to see if that works.
April 15, 2005 at 1:30 am
I think that the connection string is:
SqlConnection1.ConnectionString = "Persist Security Info=false;User ID=connect;Password=connect;Initial Catalog=Pubs;Data Source=BRENDEN"
with assembler:
System.data.SqlClient.dll 1.0.5000 from Compact Framework SDK\WindowsCE
This work fine in a PDA like a client to SQL2000 Sever.
April 15, 2005 at 8:51 am
Make sure that the windows firewall on the laptop isn't blocking your PDS'a access.
Peter
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply