+ Reply to Thread
Results 1 to 2 of 2

Thread: Problems accessing SQL Server

  1. #1
    krsh24 is offline VB.NET Forum Newbie krsh24 is on a distinguished programming path ahead
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    Sep 2006
    Age
    25
    Posts
    25
    Reputation
    50

    Default Problems accessing SQL Server

    Hi,

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

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

    Code:
    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 JohnH; 08-31-2008 at 8:13 PM. Reason: formatted post for readability

  2. #2
    pips06 is offline VB.NET Forum Newbie pips06 is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Aug 2008
    Age
    30
    Posts
    4
    Reputation
    0

    Default

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts