Pull method for sqlceremotedataaccess

Discussion in 'microsoft.public.sqlserver.ce' started by Gouri, Jun 21, 2006.

  1. Gouri

    Gouri Guest

    Hi,
    Following is the code snippet


    class RDA
    {
    private static string _serverName = "seed";
    private static string _databasePath = @"My Documents\rda.SDF";
    private static string _localConnectionString = "Data Source=" +
    _databasePath;
    private static string _internetUrl =
    "http://seed/sharefolder/sqlcesa30.dll";
    private static string _remoteConnectionString="Data Source=seed;Initial
    Catalog=AdventureWorks;User ID=sa;[email protected]";

    public static void Main(string[] args)
    {
    try
    {
    MessageBox.Show("Starting Pull", "RDA Lab");
    Pull();
    //
    }
    catch (SqlCeException ce)
    {
    ShowErrors(ce);
    }
    catch (Exception e)
    {
    MessageBox.Show(e.ToString());
    }
    finally
    {
    MessageBox.Show("Pull and Push Complete", "RDA Lab");
    }
    }

    private static void CreateDatabase()
    {
    // Create a local database
    if (System.IO.File.Exists(_databasePath))
    {
    System.IO.File.Delete(_databasePath);
    }
    SqlCeEngine engine = new SqlCeEngine(_localConnectionString);
    engine.CreateDatabase();
    }

    private static void Pull()
    {
    // Pull down the authors table from the pubs database on the remote
    server
    CreateDatabase();
    SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess(_internetUrl,
    _localConnectionString);

    rda.Pull("ContactCE", "select FirstName,Lastname from
    Person.contact", _remoteConnectionString,

    RdaTrackOption.TrackingOn);

    rda.Dispose();
    }

    }
    The error encountered is Error code : 80072F76
    Message: Header information is either corrupted or missing
    Minor error : 28035

    I can browse to the SQL server mobile agent from my emulator with the same
    internetUrl in the code snippet without any error

    Thanks

    GS
     
    Gouri, Jun 21, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.