Pull method for sqlceremotedataaccess



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;Password=P@ssw0rd";

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


.



Relevant Pages

  • pull method
    ... catch (SqlCeException ce) ... private static void CreateDatabase() ... // Pull down the authors table from the pubs database on the remote ... internetUrl in the code snippet without any error ...
    (microsoft.public.sqlserver.replication)
  • Re: Populate dataset with text file
    ... I have found this code snippet on about.com, but it does not work for me ... Connect a TADOCommand to your database using the ConnectionString or the ... >> populate a memo control in less than a second. ...
    (borland.public.delphi.database.ado)
  • Re: PInvoke threading issue
    ... One possibility is that if the third-party dll called a COM object which is ... main threaded that is to say we did not specified the thread model for the ... public static void ThreadProc() ...
    (microsoft.public.dotnet.framework.interop)
  • Re: import from text file, change rowstate
    ... > means they won't add to the database during dataadapter.update. ... Can someone toss me a code snippet? ... > 1) Change connection on the dataadapter to my Access database ...
    (microsoft.public.dotnet.framework.adonet)
  • import from text file, change rowstate
    ... Can someone toss me a code snippet? ... database is never updated because all rows are ... Change connection on the dataadapter to my Access database ...
    (microsoft.public.dotnet.framework.adonet)