Windows Mobile 5 connecting to SQL Server 2005

Can't get winmobile 5 to connect to my sql server 2005 (using vs2005). Here's the connect string:

"Data Source=tcp:XXXXXX\default,1433;Database=YYYYYY;" _
& "Integrated Security=SSPI;"

This very same string, and variations of it, work in a vs2005 winforms app, but not a windows mobile 5. I'm (obviously) using system.data.sqlclient. MS documentation says it's supported on both platforms with no syntax changes. Any suggestions



Answer this question

Windows Mobile 5 connecting to SQL Server 2005

  • arhoads76

    I've now solved my problems.
    I had the surface area configured correctly thank you. A note about this: I had to use a fixed port number when I did this. I couldn't get dynamic ports to work from the mobile over a wireless network.

    We fixed our problem by installing "SQL Client" on the mobiles. Apparently it is a requirement for SQL Server connections from the mobile but isn't detected and installed as a dependency by default. You can get the relevant install packages from the following directory on your dev machine. I think this also explains why our apps worked after debugging from VS - VS installed the SQL client.
    Dir: C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0

    This dir contains a dll and an xml file that wasn't needed (or was installed by .NET CF 2.0 IMHO) and some dirs for WM 4&5 packages on the various processors.

    There may also be a better way of installing these packages, but we haven't had time to explore that yet.

    Hope this helps!

  • Nick Spacek

    Can you please try removing "tcp" in the Data Source. Also what is the error you are getting Can you please provide more details

    Thanks,

    Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation



  • Nitesh Ambastha

    Thanks for your help :)

    I will that at the end of this week, and than say something about the results.

    Best Regards


  • Mahesh819

    Hi Seth Veale,

    Can you share the connection string that you use to RDA works with SQLExpress

    Thanks


  • hmayer

    Some more info:
    We now have 2 mobile 2003 SE devices connecting using an older cab without the debug treatment and 3 mobile 5 devices that are not connecting to the server's database instance but can ping it on the network fine (not port sweeping tho).

    When we couldn't get any of the devices to connect, we used vxUtils to find out what could be causing the issue. What we came up with was that, on all of the devices, they were able to ping the server but not port sweep 1433, which the sql server express instance was listening on.

  • Gary Mason

    Hi,
    I don't know what RDA means - it's early in the morning. :) (Remote Desktop Access is the only thing I can think of and we're just connecting to a database server.)

    This is the connection string that we're using to connect to SQL Express. In practice we're not using the sa login, we have a user set up for the app with only CRUD permissions.

    Data Source=SOMESERVER\SQLEXPRESS,1433;Initial Catalog=Database;Persist Security Info=True;User ID=sa;Password=password;Trusted_Connection=False

    To set this up, we've gone to the "SQL Server Configuration Manager" and done the tcp/ip config so that SQLExpress listens on 1433, just like in the old days. :)

    Hope that helps,
    Seth.


    EDIT: I just realised that I've already put the connection string in a previous post. If I am misunderstanding your request, please correct me and I will try and get the info you're after.

  • Eddie_gUnit

    I am also having this problem among others.

    I'm using .NET CF 2.0 and have a connection string like the following:
    Data Source=serverName\SQLEXPRESS,1433;Initial Catalog=Database;Persist Security Info=True;User ID=User;Password=Password;Trusted_Connection=False

    SQLExpress is set up to listen on 1433 and doesn't have dynamic ports enabled (I've never been able to get a device to connect to a SQL Server with dynamic ports turned on for some reason). I've disabled the test server's windows firewall for the moment to try and remove factors from the problem.

    We have a wireless network setup with a router. There is no network key or security.

    Exactly the same CF application from exactly the same cab will connect and run fine from a mobile 2003 SE device across the same network with the same connection mangler settings.

    We were previously having the same issue with the 2003 devices and could fix it by installing VS2005 on the server with the source for the project, then deploying and running the application in debug mode on the device.
    After this was done, both the debug version of the application and the release cab-installed version would connect to the server's SQL Express instance.
    Sadly, I can not remember if we tried this on a mobile 5 device but it worked on every one that we tried it on (one of which may have been mobile 5).

    Being connected to activesync didn't affect the situation at all.

    With the same server, we discovered that an older version of the cab that had exactly the same code base worked on 2003 SE devices that hadn't received the VS2005 debug treatment.

    I am having no problems what-so-ever with the parallel desktop client connecting across the network although I have personally had a hernia and thrown my toys.

    I would be enternally appreciative of the genius that can supply an answer to my and this good man's dilema.

  • King Owl

    You need to enable the remote connections using TCP/IP and named pipes in Surface Area Configuration.

    Thanks,

    Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation



  • Windows Mobile 5 connecting to SQL Server 2005