Ich habe eine Windows Phone 7-Anwendung, die eine lokale Speicherdatei (.sdf
) verwendet, um Daten zu speichern. Ich muss diese Daten mit der SQL Server-Datenbank synchronisieren, damit sie von der Website auch angezeigt und bearbeitet werden können.Datensynchronisierung von lokalen SDF und SQL Server über Sync Framework
Ich habe die Beispiele aus dem Sync Framework überprüft, aber mein Problem ist, dass kein Beispiel eine .sdf
Datei verwendet, um die Daten zu synchronisieren.
Auch das Ansichtsmodell der lokalen Datenbank auf dem Windows Phone ist wie folgt:
public class ADataContext : DataContext
{
// Pass the connection string to the base class.
public ADataContext (string connectionString)
: base(connectionString)
{ }
// Specify a table for the lists
public Table<Lists> Lists;
}
[Index(Columns = "ListName", Name = "_listNameUnique", IsUnique = true)]
[Table]
public class Lists : INotifyPropertyChanged, INotifyPropertyChanging
{
// Define ID: private field, public property, and database column.
private int _id;
[Column(DbType = "INT NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int Id
{
get { return _id; }
set
{
NotifyPropertyChanging("Id");
_id = value;
NotifyPropertyChanged("Id");
}
}
}
Gibt es eine Möglichkeit, diese lokale Datenbank (.sdf
) mit ihren passenden Tabellen in der SQL Server-Datenbank zu synchronisieren, indem der Verwendung von Sync Framework oder muss ich die Synchronisation manuell durchführen?
Wenn ich es manuell tun muss, was wäre eine optimierte Methode dafür?
dann scheint es, dass ich etwas zu tun habe !! Danke. –