SQL Server connection

G

George

I want to develop a small software in C# for Windows mobile 6 whose one of
the actions is to connect and retrieve data from the corporatre MS SQL
Server 2005. I am still in development phase with visual studio 2008. When I
create a new connection in my windows mobile form (the same way as in
windows forms for desktop windows) and try to open it returns an error with
the message "SQLException" and nothing else.

what am I doing wrong?

George
 
G

Ginny Caughey MVP

George,

Probably the problem is your connection string. From a mobile device, you
need to use the IP address and port rather than server instance name for the
SQL Server. You also need to provide \domainName\userID and password even if
you are using integrated security on the server.
 
G

George

I suspect that it is matter of network. I work at Visual Studio Emulator in
order to develop the application. Do I need to do something at the emulator
(settings or anything) in order to see the local area network?
 
G

Ginny Caughey MVP

George,

I find it's easier to "dock" the emulator and use it like a regular device.
(From VS menu - Tools, Connect to Device.)

But I find it's easiest to use a real device for anything involving
connectivity.
 
S

Simon Hart [MVP]

Also ensure remote connections is allowed. This can be configured under
Connections at server level.

Note though I wouldn't recommend connecting directly to the desktop database
server. This is usally considered bad design as you are coupling desktop and
device, not to mention opening up a massive security hole.
 

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