Adrian Botor
Adrian Botor

Reputation: 372

Connect Windows Mobile 6.5.3 application to SQL Sever 2012

We have solution based on Windows Mobile 6.5.3 and use System.Data.SqlClient to connect to our database. Everything works fine until...

After upgrade SQL Server from 2005 Workgroup Edition to 2012 standard we have problem with connections.

Real device can connect to SQL server - application works, but we can't debug project on emulators. This is strange why real device can work on that connection string. When we debug using real device we can connect to db while on emulator, we can't

W spend 2 days on searching solutions with no result.

My SQL Connection looks like

Server=xx.xx.xx.xx\InstanceName,1433;Database=dbName;User Id=userName;Password=password;Connect Timeout=30

When we call SqlConnection.Open() exception occurred.

exception view detail

        using (var sqlConnection = new SqlConnection(DatabaseConstans.ConnectionString))
        {
            sqlConnection.Open();

We did:

Other settings:

cradle

connection manager

connection settings

Upvotes: 0

Views: 1802

Answers (2)

Neil Hobson
Neil Hobson

Reputation: 515

Remove your SQL Instance name (eg SQLEXPRESS) from the Connection string.

In SQL Configuration Manager under TCP/IP Protocols, Clear ALL TCP Dynamic Ports (leave blank). Set TCP Port to 1433 under "IPALL"

So your connection string should look like: Data Source=192.168.1.53,1433;Initial Catalog=dbname;User ID=xxx;Password=xxxxx;"

This worked for me after 2 full days of trying to figure it out.

Upvotes: 0

Rick Troupin
Rick Troupin

Reputation: 11

You will need to install SQL Server Management Studio 2008 R2 (a free version is available) to open SQL CE (.SDF) files. On Connect in Object Explorer, it will provide option for SQL Server Compact..., in addition to Database Engine.

Upvotes: 0

Related Questions