SQL Server connection

  • Thread starter Thread starter George
  • Start date Start date
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
 
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.
 
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?
 
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.
 
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.
 
Back
Top