Problems accessing SQL Server

krsh24

Active member
Joined
Sep 16, 2006
Messages
25
Programming Experience
3-5
Hi,

I am new to compact edition framework. The question might be too silly, but still ..:D

I am developing a Smart device application that fetches data from a table and displays it on the grid.

VB.NET:
Dim ds As DataSet = New DataSet
Dim sConnection As String = "Data Source=K203F5BE3F\\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=mypassword;"
Dim sSQL As String = "SELECT * FROM Customers ORDER BY Country"
Dim oDap As SqlDataAdapter = New SqlDataAdapter(sSQL, sConnection)
Try 
    oDap.Fill(ds)
    dgData.DataSource = ds.Tables(0)
End Try

when i try to run the code on windows mobile 5.9 pocket pc emulator this throws an SQL exception
"Specified SQL server not found: K203F5BE3F\\SQLEXPRESS"

But the same code with the same connection string works fine on a windows application.

I am using SQL Server 2005 with management studio, compact framework 2.0.

Am i missing something that is needed to run on emulator or pocket pc?

Please help

Thanks
 
Last edited by a moderator:
Here is an example of a connection string that i use to connect to sqlexpress from one of my PDA applications.

"Data Source=servername\SQLEXPRESS,portnumber;Database=databasename;UID=sa;Password=mypassword;"

Dont forget to enable TCP/IP in SQL Express, also.
 
Back
Top