locked
Unable to connect WM6 device to SQL Express RRS feed

  • Question

  • I wrote an application in .NET that I call "SQL Test" to test the ability of device to retrieve tables from a SQL server. It has no business logic but simply verifies that you can communicate with a SQL server. Its uses a connection string stored on the device and can be edited within the application. It also has some separate functionality to test if a port is open on another computer. I made 3 versions of the application that are identical except that each is for a different platforms: windows desktop, windows mobile 6, and pocket pc 2003.

    So I have 2 SQL Express (2008 R2) servers and 1 older (9) full SQL Server, a WM6 device, a PPC 2003 device, and several other windows desktops on the same network. I need to get the WM6 device to talk to a SQL Express server and so far I have been unable to do this (except when the device is docked which won't be sufficient for what I need). The SQL servers are already configured with IP connection enabled and the port set to 1433 (see attached image serverip.png). The most important fact is the my PPC2003 device can talk to the SQL Express servers and I think that this wouldn't be the case if this were strictly a SQL Server or network configuration issue.

    I installed the SQL Test application on some desktops (not the servers), the WM6 device, and the PPC2003 device. Here are the results:

    Port 1433 for all SQL Express and Standard servers tested as open on the desktops, the WM6 device, and the PPC2003 device.

    Desktop:
    Can talk to both SQL Express and Standard using IP address, IP address + \SQLEXPRESS, machine name, or machine name + \SQLEXPRESS

    PPC2003:
    Can talk to both SQL Express servers using the using the machine name + \SQLEXPRESS only, can talk to the SQL Server the machine name or the IP address.

    WM6:
    Cannot talk to the SQL Express servers in any configuration, can talk to the SQL Server using the IP address only

    Thursday, December 22, 2011 3:42 AM

Answers

  • Are you using named instance in the connection string on device? If so try changing it to use port number instead:

    Wrong:

    DataSource=Server\InstanceName;

    Correct:

    DataSource=Server,1433;

    SQL Server instance you're connecting to should have TCP/IP protocol enabled (which you may or may not have done - check Protocol tab) and configured to listen on specific port (which you seem to set up correctly). After that is done make sure firewall on your PC allows for incoming connections on that port. Verify connectivity by using any port scanning tool either from device (better) or from another PC.

    See this for tutorial: http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Jesse Jiang Friday, December 23, 2011 8:09 AM
    • Marked as answer by Jesse Jiang Thursday, December 29, 2011 3:05 AM
    Thursday, December 22, 2011 10:25 PM
  • It looks like having data source=[IP address],1433 was the answer. Thank you.
    • Marked as answer by Jesse Jiang Thursday, December 29, 2011 3:05 AM
    Wednesday, December 28, 2011 2:39 AM

All replies

  • Are you using named instance in the connection string on device? If so try changing it to use port number instead:

    Wrong:

    DataSource=Server\InstanceName;

    Correct:

    DataSource=Server,1433;

    SQL Server instance you're connecting to should have TCP/IP protocol enabled (which you may or may not have done - check Protocol tab) and configured to listen on specific port (which you seem to set up correctly). After that is done make sure firewall on your PC allows for incoming connections on that port. Verify connectivity by using any port scanning tool either from device (better) or from another PC.

    See this for tutorial: http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Jesse Jiang Friday, December 23, 2011 8:09 AM
    • Marked as answer by Jesse Jiang Thursday, December 29, 2011 3:05 AM
    Thursday, December 22, 2011 10:25 PM
  • It looks like having data source=[IP address],1433 was the answer. Thank you.
    • Marked as answer by Jesse Jiang Thursday, December 29, 2011 3:05 AM
    Wednesday, December 28, 2011 2:39 AM