JohnCoers
asked on
Windows CE SQL Connectivity Problem
I have written a Windows CE app that works when connecting to one SQL Server, but does not work when connecting to the other.
This connection string works:
server=DYNAMICS;uid=xxxx;p wd=xxxx;da tabase=SHF 09
However, this connection string does not:
server=V1S1\SQLSERVER;uid= xxxx;pwd=x xxx;databa se=SHF09
Both are SQL Server 2005 databases and both servers are set to allow remote connections. Any ideas?
This connection string works:
server=DYNAMICS;uid=xxxx;p
However, this connection string does not:
server=V1S1\SQLSERVER;uid=
Both are SQL Server 2005 databases and both servers are set to allow remote connections. Any ideas?
the error code would be helpful :)
ASKER
"Specified SQL server not found: DCS\DCS"
System.Data.SqlClient.SqlE xception was unhandled
Class=20
LineNumber=0
Message="SqlException"
Number=6
Procedure="ConnectionOpen (Connect())."
Server="DCS\DCS"
Source=".Net SqlClient Data Provider"
State=0
StackTrace:
at System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, TdsParserState state)
at System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, TdsParserState state)
at System.Data.SqlClient.TdsP arser.Thro wException AndWarning ()
at System.Data.SqlClient.TdsP arser.Conn ect(String host, SqlInternalConnection connHandler, Int32 timeout)
at System.Data.SqlClient.SqlI nternalCon nection.Op enAndLogin ()
at System.Data.SqlClient.SqlI nternalCon nection..c tor(SqlCon nection connection, Hashtable connectionOptions)
at System.Data.SqlClient.SqlC onnection. Open()
at VB_ScanSample1.ReaderForm. ReaderForm _Load(Obje ct sender, EventArgs e)
at System.Windows.Forms.Form. OnLoad(Eve ntArgs e)
at System.Windows.Forms.Form. _SetVisibl eNotify(Bo olean fVis)
at System.Windows.Forms.Contr ol.set_Vis ible(Boole an value)
at System.Windows.Forms.Appli cation.Run (Form fm)
at VB_ScanSample1.ReaderForm. Main()
InnerException:
System.Data.SqlClient.SqlE
Class=20
LineNumber=0
Message="SqlException"
Number=6
Procedure="ConnectionOpen (Connect())."
Server="DCS\DCS"
Source=".Net SqlClient Data Provider"
State=0
StackTrace:
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlC
at VB_ScanSample1.ReaderForm.
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Appli
at VB_ScanSample1.ReaderForm.
InnerException:
does this server name ring any bells? it looks like wrong server name in the connection string, does it look correct under debugger? maybe you have there some characters escaped (like \S), although this doesn't seem possible from the error stack
ASKER
Oops, I sent you the code after I tried to hit yet another SQL Server. The result is the same though. It returns the same error whether I'm trying for "V1S1\SQLSERVER" or "DCS\DCS".
ok, few things to try:
1) as mentioned eg here (http://www.connectionstrings.com/sql-server-2005) you can try DataSource instead of Server
2) http://msdn.microsoft.com/en-us/library/aa275613(SQL.80).aspx maybe helpful too
3) try IP address instead of server name, there was a bug in cf.net with DNS resolution
1) as mentioned eg here (http://www.connectionstrings.com/sql-server-2005) you can try DataSource instead of Server
2) http://msdn.microsoft.com/en-us/library/aa275613(SQL.80).aspx maybe helpful too
3) try IP address instead of server name, there was a bug in cf.net with DNS resolution
ASKER
Based on those articles, I changed the connection string to:
Data Source=xxx.xxx.xxx.xxx;Ini tial Catalog=SHF09;Integrated Security=SSPI;User ID=xxx\xxxx;Password=xxxxx ;
Which now gives me a new error:
"General network error. Check your network documentation."
System.Data.SqlClient.SqlE xception was unhandled
Class=20
LineNumber=0
Message="SqlException"
Number=11
Procedure="ConnectionRead (recv())."
Server="xxx.xxx.xxx.xxx"
Source=".Net SqlClient Data Provider"
State=0
StackTrace:
at System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, TdsParserState state)
at System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, TdsParserState state)
at System.Data.SqlClient.TdsP arser.Thro wException AndWarning ()
at System.Data.SqlClient.TdsP arser.Read Netlib(Int 32 bytesExpected)
at System.Data.SqlClient.TdsP arser.Read Buffer()
at System.Data.SqlClient.TdsP arser.Read Byte()
at System.Data.SqlClient.TdsP arser.Run( RunBehavio r run, SqlCommand cmdHandler, SqlDataReader dataStream)
at System.Data.SqlClient.TdsP arser.Run( RunBehavio r run)
at System.Data.SqlClient.SqlI nternalCon nection.Lo gin(Int32 timeout)
at System.Data.SqlClient.SqlI nternalCon nection.Op enAndLogin ()
at System.Data.SqlClient.SqlI nternalCon nection..c tor(SqlCon nection connection, Hashtable connectionOptions)
at System.Data.SqlClient.SqlC onnection. Open()
at VB_ScanSample1.ReaderForm. ReaderForm _Load(Obje ct sender, EventArgs e)
at System.Windows.Forms.Form. OnLoad(Eve ntArgs e)
at System.Windows.Forms.Form. _SetVisibl eNotify(Bo olean fVis)
at System.Windows.Forms.Contr ol.set_Vis ible(Boole an value)
at System.Windows.Forms.Appli cation.Run (Form fm)
at VB_ScanSample1.ReaderForm. Main()
InnerException:
Data Source=xxx.xxx.xxx.xxx;Ini
Which now gives me a new error:
"General network error. Check your network documentation."
System.Data.SqlClient.SqlE
Class=20
LineNumber=0
Message="SqlException"
Number=11
Procedure="ConnectionRead (recv())."
Server="xxx.xxx.xxx.xxx"
Source=".Net SqlClient Data Provider"
State=0
StackTrace:
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlC
at VB_ScanSample1.ReaderForm.
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Appli
at VB_ScanSample1.ReaderForm.
InnerException:
ASKER
Also, I'm certain that the IP address, User id and password are correct for the connection.
The part that I find interesting is that I CAN hit the SQL Server which does not designate it's computer name, "DYNAMICS". The other connections don't seem to work because the computer name is part of the SQL Server's name. Does that make sense?
The part that I find interesting is that I CAN hit the SQL Server which does not designate it's computer name, "DYNAMICS". The other connections don't seem to work because the computer name is part of the SQL Server's name. Does that make sense?
ok, could you try to connect from iSql utility? it looks to me like some sort of network resolution issue, but I may be wrong
ASKER
I've not used the ISql Utility before, but I can connect from the SQL Manager and all of my other .net programs can connect to any of the servers.
yes, but you need to check it from WinCE, not from desktop apps.
so iSql might give more info
so iSql might give more info
ASKER
Ok. I hate to seem totally clueless, but how do I fire up ISql in CE?
you need to install dev cab (if I'm not mistaken) which includes iSql utility, then run it on device
ASKER
I've looked all over the place and cannot find the download for ISql onto the CE device.
do you have Sql Server installed? then you should have <some path>\vX.X\Devices\wce500\ <processor >\*.dev*.c ab
ASKER
No, I never installed SQL on the CE device. I was hoping I would not need it.
no no, I mean on your desktop
ASKER
Ah, ok. I'll dive into it. Thanks!
you ideally you should have cabs on your desktop, then you copy proper one to the device and install it, then run that utility and see what happens
ASKER
At this point, I'm considering just moving my application to a server and letting the device RDP to the server. I think I would feel a little more comfortable from a stability standpoint. This quirky behavior is making me nervous.
if you can do it then that's fine.
just check that it can then connect with RDP :)
just check that it can then connect with RDP :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.