Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Connecting WinCE 5 To Database

Hello,

I don't know if it's appropriate, but i do have the same situation and problem.

I have wireless connection and database rights. I have tested the connection for the same user from another pc.

When i run the following
mySqlConnection = New SqlConnection("server=MyServer;Trusted_Connection=yes;database=MyDB;usr=teo;password=teo")

I get a time out. I tried also some variations of the connection string ("Data source" instead of "server", "User ID" instead of "usr") but the problem continuous.

The same code runs ok if i build it as a Windows Application and run if from a network pc.

Thank you.

Teo
[684 byte] By [temm] at [2007-11-11 11:58:01]
# 1 Re: Connecting WinCE 5 To Database
Welcome to dev-archive :WAVE:

It certainly is appropriate, but it should be in its own thread, so I created one for you.

What happens when you try to connect to CE? Do you get error? Does nothing happeng?
Hack at 2007-11-11 23:42:33 >
# 2 Re: Connecting WinCE 5 To Database
Thank you for prompt reply.

What do you mean by 'try to connect to CE?'.

I haven't installed any sql server mobile edition. Do i need to? I will need some sort of database to hold me entries when i am offline (no wireless) but this is for the future.

Do I need to install mobile edition at the moment or something else?

Thank you.

Teo
temm at 2007-11-11 23:43:44 >
# 3 Re: Connecting WinCE 5 To Database
Maybe I'm misunderstanding your question.

Is it that you want to connect to your network database from your mobile unit, or run a database from your mobile unit? (Or, both?)
Hack at 2007-11-11 23:44:37 >
# 4 Re: Connecting WinCE 5 To Database
Exactly, i'm trying to connect from ce to the network database.

I just got confused with you question
"What happens when you try to connect to CE? "

Thank you.

Teo
temm at 2007-11-11 23:45:42 >
# 5 Re: Connecting WinCE 5 To Database
To answer what happens when i try to connect to the network database is that it waits for a while 10-15sec and then fails.

Teo
temm at 2007-11-11 23:46:46 >
# 6 Re: Connecting WinCE 5 To Database
The same code runs ok if i build it as a Windows Application and run if from a network pc.Based on this, it is apparent that it isn't your code, or this wouldn't work either.

Can you connect to, and do anything on, the network itself (for get the database for a moment)?
Hack at 2007-11-11 23:47:45 >
# 7 Re: Connecting WinCE 5 To Database
Well at the moment i can ping the database server.

Should this be just ok or should i do something else also?

Teo
temm at 2007-11-11 23:48:49 >
# 8 Re: Connecting WinCE 5 To Database
I have copied all the files from the bin\release directory of my project to the win ce device. That is

testApp.exe
testApp.pdb
testApp.xml
System.Data.SqlClient.dll
System.Data.SqlClient.xml

Is this correct or am i missing something?

Teo
temm at 2007-11-11 23:49:50 >
# 9 Re: Connecting WinCE 5 To Database
Run it and see what happens.
Hack at 2007-11-11 23:50:47 >