I am stuck while doing synchronization between SQL Server 2000 and SQL Server CE 2.0.
getting an Error "Header information is either corrupted or missing."
My Specification is follow :
Windows XP with SP2
Visual Studio 2005 Enterprise edition
SQL Server 2000 (SP3a)
SQL Server CE 2.0
Application is Smart Device application (Pocket PC 2003) using C#.
Microsoft ActiveSync 4.5
IIS 5.1
I followed steps as per given in this URL :
http://msdn2.microsoft.com/en-us/library/ms839425.aspx#sql_serverce_replication_net_topic2
I performed eeach steps successfully, My code is as per given below.
private void button1_Click(object sender, EventArgs e)
{
getSyncReady();
}
SqlCeReplication loSqlCeReplication;
private void getSyncReady()
{
try
{
String lsDBFile = "Northwind.sdf";
loSqlCeReplication = new SqlCeReplication();
loSqlCeReplication.InternetUrl = "http://192.168.0.5/Northwind/sscesa20.dll";
loSqlCeReplication.Publisher = "C99";
loSqlCeReplication.PublisherSecurityMode = SecurityType.NTAuthentication;
loSqlCeReplication.Publication = "NorthwindProducts";
loSqlCeReplication.PublisherDatabase = "Northwind";
loSqlCeReplication.Subscriber = Dns.GetHostName();
loSqlCeReplication.SubscriberConnectionString = "Data Source=" + lsDBFile;
if (!System.IO.File.Exists(lsDBFile))
{
MessageBox.Show("The application requires synchronization", "Replicator",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
loSqlCeReplication.AddSubscription(AddOption.CreateDatabase);
}
loSqlCeReplication.Synchronize();
}
catch (Exception foException)
{
throw foException;
}
}
I am not getting whats going wrong.
My Firewall is disable and i have not installed any antivirus softwares (including Norton internet Security....in many forums i got this suggestion but i think its not an issue,even though for solving this issue i performed new installation of Windows XP SP-2 )
If you are using VS 2005 only SQL CE 3.x is supported, so you must install the SQL CE 3.0 agent on the web server and change your url to point to:
http://192.168.0.5/Northwind/sscesa30.dll
The SQL CE connectivity tools page is at: http://www.microsoft.com/sql/editions/sqlmobile/connectivity-tools.mspx
and can be downloaded from: http://www.microsoft.com/downloads/details.aspx?FamilyId=4E45F676-E69A-4F7F-A016-C1585ACF4310&displaylang=en
|||As per your suggestion i changed my Internet URL to (Using SQL Server 2005 Compact Edition)http://192.168.0.5/Sync1/sqlcesa30.dll
Sync1 is my virtual directory for Northwind Database.
My code is as follow.
String lsDBFile = "Northwind.sdf";
loSqlCeReplication = new SqlCeReplication();
loSqlCeReplication.InternetUrl = "http://192.168.0.5/Sync1/sqlcesa30.dll";
loSqlCeReplication.InternetLogin = @."narolainfotech\gketan";//My login information for IIS
loSqlCeReplication.InternetPassword = "*******";
loSqlCeReplication.Publisher = "C99";//SQL Server Name
loSqlCeReplication.PublisherLogin = "sa";//Login for SQL Server 2000
loSqlCeReplication.PublisherPassword = "********";//Password for SQL Server 2000
loSqlCeReplication.PublisherSecurityMode = SecurityType.DBAuthentication;
loSqlCeReplication.Publication = "NorthwindPublisher";//Publisher Name
loSqlCeReplication.PublisherDatabase = "Northwind";//Database Name
loSqlCeReplication.Subscriber = Dns.GetHostName();
loSqlCeReplication.SubscriberConnectionString = "Data Source=" + lsDBFile;
if (!System.IO.File.Exists(lsDBFile))
{
loSqlCeReplication.AddSubscription(AddOption.CreateDatabase);
}
loSqlCeReplication.Synchronize();
MessageBox.Show("Synchronization done.");
}
catch (Exception foException)
{
throw foException;
}
Now i am getting an error "A call to SQL Server Reconciler failed. Try to resynchronize."
Do you know what is any issue?
Help?
|||Please get more error information, see http://msdn2.microsoft.com/en-us/library/ms174079.aspx
It is likely a permissions issue, please refer to these walkthroughs for configuring replication properly:
This sample allows two way sync: http://technet.microsoft.com/en-us/library/ms346580.aspx
and so does this Hands On Lab: http://msdn2.microsoft.com/en-us/library/aa454892.aspx
No comments:
Post a Comment