I am maintaining/building a Windows Forms application (family project) using Visual Studio Community 2019, AForge and SQLite.
The application has been working for over 3 years with frequent amendments and additions.
For the latest change I created two user controls, both where owner draw listboxes (drawing a colour background for each item. One of the controls was added to the form and worked fine, when trying to add the second control it fails with a message which says the SQLite.Interop.dll is not available or corrupted, if I try to place the control a second time VS deletes it from the project, after which every sqlite statement errors and there is no way to recover the project.
Which is why I created a minimum failing program, and it did fail.
What have I missed; any suggestions helped apricated? I need a disconnected, serverless database.
The only alternative I have found was not SQL, I started programming with PL1, I was there at the berth of SQL and way to old to learn new stuff.
1, created a User control that calls
static public DataTable GetColours()
{
DataTable Colours = new DataTable();
Colours.Columns.Add("colour_group_id", typeof(int));
etc ...
Colours.TableName = "ColourInGroups";
SQLiteConnection objConn = new SQLiteConnection(DB_Connect_String());
string sql = "SELECT ... ORDER BY sort_order;";
SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, objConn);
SQLiteCommandBuilder command = new SQLiteCommandBuilder(adapter);
adapter.Fill(Colours);
return Colours;
}
// END GetColours()
3. Installed the following NuGet packages
• System.DataSQLite
• System.DataSQLite.Core
• System.DataSQLite.EF6
• System.DataSQLite.Linq
In fact System.DataSQLite included the other three.