0

I am developing an application for a handheld device with Win CE 7.0 in VS 2008. The application has to connect to SQL Server 2000 database.

I use this connection string "Data Source=999.99.99.99,1433; Initial Catalog = DBname; User Id=UserID; Password=UserPassword; Application Name=Application; "

It works perfectly fine when it runs on the handheld device. But in Debug mode under Visual Studio, that same database connection fails complaining about Login Failed For User, error 18456 state 1.

I already tried User Id = domain\userid, and it did not help.

Does anyone have any idea what can be the cause of this?

Thank you.

user819490
  • 125
  • 1
  • 11

2 Answers2

0

How do you connect to your device from VS? Do you use ActiveSync? In the past AS used to have also TCP/IP routing over it, so it may be that when you are connected the connection is routed on the AS connection instead of the wi-fi one.

Valter Minute
  • 2,177
  • 1
  • 11
  • 13
  • Hi Valter, thank you for your reply. Yes, I am connecting through the ActiveSync, and your answer makes sense. But in ActiveSync I do not really have any options in setting up db connections - at least I have not seen any. Would you have any idea how I can make this work? – user819490 Sep 09 '16 at 12:42
0

Armed with info from Valter, I did some more digging, and sure enough I stumbled on this link:

connecting sql server from windows ce application through Activesync without being on network

In my case, I had to fire up the ActiveSync (in case of wince over 6.0 you do not have to fire it up manually to run application from under VS, so you may not even realize that it is running in the background) with the device in the cradle.

In ActiveSync before starting VS, I went to Mobile Device Settings -> Connection Settings, and chose Connect to: Work Network from the drop down (instead of default Automatic). Then started the VS, and my connection worked perfectly fine.

Community
  • 1
  • 1
user819490
  • 125
  • 1
  • 11