|Title:||Creating a changeset is not working|
|Last Modified:||2018-08-10 18:00:29|
|Version Found In:||1.0.108|
anonymous added on 2018-08-07 13:31:03:
I'm currently writing on my bachelor thesis and wanted to use the session extension in .NET to track changes made on the database. I wrote this code to generate a changeset (the documentation on this for .NET is quite poor): var connection = new SQLiteConnection("Data Source=test.sqlite"); connection.Open(); var session = connection.CreateSession("main"); session.AttachTable("Test"); connection.ExecuteSqlCommand("INSERT INTO Test (Id, Description) VALUES (?, ?)", 0, "testbeschreibung"); //my extension method which creates a SQLiteCommand with Parameters and executes it byte rawChanges = new byte; session.CreateChangeSet(ref rawChanges); The database consists only of the table "Test" with columns "Id" (int, Primary Key) and "Description" (text). The data insertion is working fine, but rawChanges does not contain anything. I also tried .CreateChangeSet() with a stream instead of a byte array, but it did not change anything. Am I missing an important step or is it just not working? Thanks in advance, Patrick Seiter
anonymous added on 2018-08-07 15:16:53:
Nevermind, after changing session creation into this: SQLiteConnection.CreateSession(SQLiteConnection.Database); it worked. Problem solved.