Search code examples
c#compact-frameworkwindows-mobile-6.1

Windows Mobile 6.1 machine cannot connect to sql server while plugged in


I am writing a .net cf 2.0 application on a Windows Mobile 6.1 machine. The machine was causing me a lot of trouble with wifi connections at first, but then it just worked for a while.

However, almost 10 days ago, the the machine stopped connecting to the sql server (on the same network) only while it's plugged in. Internet works fine though. When I unplug the machine it connects normally to sql server.

Any help would be appreciated. This problem is preventing me from debugging the application.

I tried a demo project to confirm this, here is the code:

    static void Main()
    {
        connection = GlobalFields.MainTableAdapter.Connection;
        GlobalFields.OrdersAdapter.Connection = connection;

        connection.Open(); // I get an SqlException with no details if the 
                           // machine is connected (probably caused by a timeout)

        Application.Run(new frmLogin());
    }

Solution

  • I found the reason for the problem. It turns out that our network administrator installed a proxy server that periodically forces the handheld device to go through it, and then prevents it from accessing the the sql server on the network.

    All I need to do is go to the network settings and disable the option to use the proxy server, then everything works fine.