Pull method for sqlceremotedataaccess
- From: "Gouri" <gourisohoni@xxxxxxxxxxx>
- Date: Wed, 21 Jun 2006 14:56:36 +0530
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
.
- Prev by Date: Re: ATL OLEDB Consumer Templates, SQL CE
- Next by Date: Permission Denied 80040E09
- Previous by thread: question about Sql Everywhere
- Next by thread: Permission Denied 80040E09
- Index(es):
Relevant Pages
|