locked
Platform NotSupportedException while trying to Connect SQL Server 2005 SP1 ? RRS feed

  • Question

  • Hi everybody

    After I read an article about connecting SQL Server 2005 SP1 using Smart Device Applications

    http://community.opennetcf.com/articles/cf/archive/2007/09/20/developing-connected-smart-device-application-with-sqlclient.aspx

    I tried that but I got a strange two states :

    1- when the login credentials are wrong I got an exception "Login Field for user 'MyUser' ", I supposed I got it, but !!!

    2- when I corrected the login parameters in the connection string I got an exception "NotSupportedException" .

     

    using the windows mobile 5 emulator and a smart device application with the following code for connection :

     

       

    try
    {

    SqlConnection sqlConn = new SqlConnection("Data Source=myServer;Initial Catalog=myDB;User ID=myUser;pwd=myPassword");

    if (sqlConn.State != ConnectionState.Open)
    {
    sqlConn.Open();
    MessageBox.Show("The connection Succeeded !");
    }

    }
    catch (SqlException ex)
    {
    MessageBox.Show(ex.Message);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message );
    }

     


    Articles without an example are not clear !
    Sunday, September 6, 2009 8:45 PM

Answers

All replies