none
Problem with RDA pull()

    Question

  • hello, i've checked anonymous access in authentication method in IIS and set username: "ROYAN\IUSR_ROYAN" and password:"hesam" and added "IUSR_ROYAN" to administrator group in computer management and set its password to "hesam". one of my log ins in sql server management studi is "royan-project" and I'm running c sharp project on a windows ce 6 and sql ce 3.5.

    IE shows Microsoft SQL Server Compact Server Agent in both windows xp and windows ce on both addresses http://royan/sqlcevd/sqlcesa35.dll and http://192.168.1.100/sqlcevd/sqlcesa35.dll

    my local database exists and is not empty but when pulling data from sever error message 28559 -2147467259 shows up " SQL Server Compact encountered problems when opening the database. [ Internal Error Number = 0,Internal Error String =  ]. here is my code, can you help me?

                //Provider=Microsoft.SQLSERVER.OLEDB.CE.3.5;
                string rdaOleDbConnectString = @"Provider=SQLOLEDB; Data Source=192.168.1.100;Initial Catalog=test;User Id=royan-project;Password=123456789; Persist Security Info=False;";
                //string rdaOleDbConnectString = @"Provider=SQLOLEDB; Data Source=royan-f41dede0d;Initial Catalog=test;User Id=royan-project;Password=123456789; Persist Security Info=False;";
                SqlCeRemoteDataAccess rda = null;
                //try
                //{
                    rda = new SqlCeRemoteDataAccess();
                    //rda.InternetLogin = "Administrator";
                    //rda.InternetPassword = "24044";
                    rda.InternetLogin = "IUSR_ROYAN";
                    rda.InternetPassword = "hesam";
                    rda.InternetUrl = "http://192.168.1.100/sqlcevd/sqlcesa35.dll";
                    //rda.InternetUrl = "http://royan/sqlcevd/sqlcesa35.dll";
                    rda.LocalConnectionString = @"Data Source=\\test\\test1.sdf; Password=12345";

                    rda.Pull(
                        "tab1",
                        "SELECT * FROM tab1",
                        rdaOleDbConnectString,
                        RdaTrackOption.TrackingOnWithIndexes,
                        "ErrorTable");
                /*}
                catch (SqlCeException ex)
                {
                    MessageBox.Show(ex.Source.ToString());
                    MessageBox.Show(ex.HResult.ToString());
                    MessageBox.Show(ex.NativeError.ToString());


                }
                finally
                {
                    rda.Dispose();
                }
                */



    • Edited by HESAMODDIN Saturday, November 12, 2011 9:49 AM
    Saturday, November 12, 2011 9:39 AM

Answers

  • Sorry, did not realize that, in that case your connection string shoule be: @"Data Source=\test\test1.sdf; Password=12345";

    And test.sdf exists in the \Test folder?


    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Marked as answer by HESAMODDIN Saturday, November 12, 2011 1:42 PM
    Saturday, November 12, 2011 10:14 AM
    Moderator

All replies

  • The path to your local database is wrong, it should be a local disk, not a share

    So @"Data Source=\\test\\test1.sdf; Password=12345"; should be @"Data Source=c:\test\test1.sdf; Password=12345";
     

     


    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Saturday, November 12, 2011 9:58 AM
    Moderator
  • my local is on a windows ce on an arm processor an there is no such drive c or any kind of drive and any address from root starts with \ ,but nevertheless i changed as you said and it gives this error:

    SQL Server Compact encountered problems when opening the database. [ Internal Error Number = 25010,Internal Error String = The file name is not valid. Check the file name for the database. [,,,File name,,] ]

    so i think problem is some where else.

    Saturday, November 12, 2011 10:09 AM
  • Sorry, did not realize that, in that case your connection string shoule be: @"Data Source=\test\test1.sdf; Password=12345";

    And test.sdf exists in the \Test folder?


    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Marked as answer by HESAMODDIN Saturday, November 12, 2011 1:42 PM
    Saturday, November 12, 2011 10:14 AM
    Moderator
  • yes it does. i think if we can trace some thing

    1. can authentication anonymous user and password be every thing i like and i type in the box or should be selected from browse button and advanced window and searching for existing users?

    2. i've chosen sql server authentication in sql server management studio as connection and user name royan-project and password 123456789. should this user and pass be the same as the ones in paragraph above about anonymous user and pass?

    Saturday, November 12, 2011 10:52 AM
  • I think the error is related to access to the local database file, not the server.
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Saturday, November 12, 2011 11:18 AM
    Moderator
  • ok i did that change :

    rda.LocalConnectionString = @"Data Source=\test\test1.sdf; Password=12345";
    rda.Pull(
    "tab1",
    "SELECT * FROM tab1",
    rdaOleDbConnectString,
    RdaTrackOption.TrackingOnWithIndexes);

    but now the error is changed to this one :

    The LocalTableName parameter is already specified. [ Table name = tab1 ]

    Saturday, November 12, 2011 11:20 AM