Connecting Tech Pros Worldwide Help | Site Map

Problem with connecting to database from Pocket PC Emulator

Newbie
 
Join Date: Aug 2007
Posts: 2
#1: Aug 9 '07
Hi,
I am developing a Device Aplication in C# and I have a problem with connection from Visual Studio 2005 to SQL Server 2005.
My connection string should be correct:
Expand|Select|Wrap|Line Numbers
  1. SqlConnection cn = new SqlConnection;
  2. cn.ConnectionString="Data source=MyPC;Initial Catalog=MyDB;User ID=MyID;Password=MyPassword;"
  3. try {
  4. cn.Open // this is where I get sqlException: Specified SQL server not found: MyPC
  5. ...
I enabled TCP/IP in SQL Server Configuration Manager under "Protocols for MSSQL" and cleared TCP Dynamic ports. I set in menu "IP All" TCP Port to 1433. I restarted the server.
I turned off the firewall.
When I run
Expand|Select|Wrap|Line Numbers
  1. netstat -n -a
in the command prompt I can see address 0.0.0.0:1433 LISTENING.
I can add a new DataSet to my project from menu Data->Add Connection. I use SQL Server Authentication with a correct name/password. When I press the button "Test Connection" it works.

I also added DataGrid to the form using the added DataSet. When I debug the project with the Pocket PC 2003 SE Emulator deployed I get instead of the data table sqlException.
Can anyone help me ?
Newbie
 
Join Date: Aug 2007
Posts: 2
#2: Aug 10 '07

re: Problem with connecting to database from Pocket PC Emulator


The other problem that I had was that I was using Windows Vista.
I found out that I needed to upgrade Emulator to the version 2.0 and to install Windows Mobile Device Center.
I set up the connection to emulator as "DMA default".
The last thing was to set up emulator as "Cradle" in Device Emulator Manager.
Reply