Dear All
Synchronizing SQL Server and SQL Server Compact
Walkthrough: Provisioning a SQL Compact Client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlServerCe;
using Microsoft.Synchronization;
using Microsoft.Synchronization.Data;
using Microsoft.Synchronization.Data.SqlServer;
using Microsoft.Synchronization.Data.SqlServerCe;
namespace ProvisionClient
{
class Program
{
static void Main(string[] args)
{
// create a connection to the SyncCompactDB database
SqlCeConnection clientConn = new SqlCeConnection(@"Data Source='C:\SyncSQLServerAndSQLCompact\SyncCompactDB.sdf'");
// create a connection to the SyncDB server database
SqlConnection serverConn = new SqlConnection("Data Source=localhost; Initial Catalog=SyncDB; Integrated Security=True");
// get the description of ProductsScope from the SyncDB server database
DbSyncScopeDescription scopeDesc = SqlSyncDescriptionBuilder.GetDescriptionForScope("ProductsScope", serverConn);
// create CE provisioning object based on the ProductsScope
SqlCeSyncScopeProvisioning clientProvision = new SqlCeSyncScopeProvisioning(clientConn, scopeDesc);
// starts the provisioning process
clientProvision.Apply();
}
}
}
while executing the above code the following error occurred.
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Data.
SqlServerCe.TrackingOptions' from assembly 'System.Data.SqlServerCe, Version=3.5
.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.
at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncTableHelper.EnableOcsT
racking(SqlCeTransaction trans)
at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncTableProvisioning.Appl
y(SqlCeTransaction trans)
at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncScopeProvisioning.Appl
yInternal(SqlCeConnection connection)
at Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncScopeProvisioning.Appl
y()
at ProvisionClient.Program.Main(String[] args) in E:\MKM\Dotnet\VS2008\Consol
eApplication\SyncSQLServerAndSQLCompact\ProvisionClient\Program.cs:line 32
Press any key to continue . . .
how can solve this error?. Please help me.
Muhammedali