Connect to SQL Express from CE 5.0

T

Tedmond

Dear all,

I need to connect to SQL express from my mobile device which running the CE
5.0. When I make the connection, it returns the error 'Specified SQL server
not found'. I did connect the mobile to device to the PC through ActiveSync.
The firewall of the PC is off. Can anyone tell me what cause the error and
how to fix it?

Thanks for any help,

Tedmond
 
P

Paul G. Tobey [eMVP]

Does SQL Express support remote access to data? Show us how you are trying
to make the connection and give us the version of SQL Express, the version
of the .NET CF in your device, etc., etc.

Paul T.
 
T

Tedmond

Dear Pete and Paul,

The SQL I use is Microsoft SQL Server 2005 (SQL Server 9.0.3068). I did
enable the remote access and it is able to be connected by other PC. My
device is running CF2.0. I write a very simple .Net 2005 program that try to
connect to my pc using the following connection string.

connstr = "Data Source=192.168.10.102\SQLEXPRESS;Initial Catalog=DEMO;User
ID=sa;Password=123456";

Then I try
SqlConnection mConn = new SqlConnection(connstr);

mConn.Open();

It return the error I reported.

The device is able to connect to Internet.

Please help.

Thanks

Tedmond
 
P

Paul G. Tobey [eMVP]

Take a look at the documentation for SqlConnection.ConnectionString. I
think that you've just got a bad string there. I always put single quotes
around my passwords and I'm not sure about the <ip>\<path> syntax; that
seems wrong. I would expect it to be just a name, no path and not an IP
address.

Paul T.
 
T

Tedmond

Dear Paul,

The connection string seems ok. I used this format in my PC program that
works. Fory this case, the error returned is 'Specified SQL Server not
found'. If I made some mistake on the connection string, it show other error.

Do I need to specify the port number in connecting string for mobile device
connection?

Any other idea?

Thanks for any help.

Tedmond
 
P

Paul G. Tobey [eMVP]

You're assuming a lot! Windows CE != Windows XP. If the server name is
"MYSERVER", try just setting the Data Source to "MYSERVER", forgetting about
the path and see if that behaves any differently.

Paul T.
 
P

Paul G. Tobey [eMVP]

I've done a quick verification that

Data Source=172.16.1.2;

will work fine and that

Data Source='MYCOMPUTER';

also works, at least for me, running a up-market version of SqlServer and
the SQL client 2.0 for .NET CF on Windows CE 5.0.

Paul T.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
 
M

Mehmet AVSAR

Ensure that SQL Server's Surface Area Configuration allows remote
connections over TCP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top