SQLite.Net Extensions Data insertion error!

Issue #72 resolved
Sumesh Chandran created an issue

Hello,

I have been using the SQLiteAsyncConnection for all the database operations and it was recently I came to know that it doesn't allow association between tables. Now I am in the process of moving the code to use the SQLite.Net Extension which supports extensions. I have found a weird issue when I insert datetime data into the table. It completely changes the datetime on insertions.

App.db2.Insert(new FrequentlyAssignedShifts()
                    {
                        ShiftStart = Convert.ToDateTime(btnShiftStart.Content.ToString()),
                        ShiftEnd = Convert.ToDateTime(btnShiftEnd.Content.ToString()),
                    });

And this is how the connection is established.

string databasePath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "Scheduler.sqlite");
        public static SQLiteConnection db2;
var platform = new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT();
            db2 = new SQLiteConnection(platform, databasePath);

I checked until the last point using breakpoints, whether the right data is getting inserted. It all seems fine, it is getting the right date from the button controls, but the moment it passes this part of the code the date value changes. The "ShiftStart & ShiftEnd" variables are datetime variables in the Table. Could someone please advise.

Thanks for reading the post.

Comments (1)

  1. Log in to comment