Small console demo that creates a local SQLite database, defines a single ControlEvent table (matching an existing SQL Server schema), inserts sample rows, and reads/prints them to the console.
Copyright © 2026 by The ep5 Educational Broadcasting Foundation; all rights reserved.
This program is a lightweight utility intended to produce TaskSchedulerOneTimeSealevel.db in the working directory for testing or migration purposes.
For information on the entire ep5BAS project, please see https://www.ep5bas.org.
- Language: C# (preview features / C# 14.0)
- Target framework: .NET 10
- Example source:
Program.cs(creates table, inserts sample data, reads records) - NuGet dependency:
System.Data.SQLite.Core
The code is adapted from an example by Tapas Pal (see Program.cs header for attribution).
- .NET 10 SDK installed
- (Recommended) Visual Studio 2026 or later
- Add the SQLite provider package:
- CLI:
dotnet add package System.Data.SQLite.Core - Visual Studio: open the project, right-click the project → Manage NuGet Packages and install
System.Data.SQLite.Core.
- CLI:
If using Visual Studio, ensure the project Target Framework is set to .NET 10 under Project Properties.
- Restore and add the package (if not already added):
dotnet restoredotnet add package System.Data.SQLite.Core
- Build:
dotnet build
- Run:
dotnet run --project <path-to-project>
When run, the program:
- Creates (or opens)
TaskSchedulerOneTimeSealevel.dbin the current working directory. - Creates the
ControlEventtable. - Inserts four sample records.
- Reads and prints each record to the console.
The SQLite file TaskSchedulerOneTimeSealevel.db is created in the process working directory (typically the project output / project root when using dotnet run).
- Connection string is defined in
Program.cs:Data Source = TaskSchedulerOneTimeSealevel.db; Version = 3; New = True; Compress = True;
- Adjust the connection string if you want the DB placed elsewhere or different connection options.
- If you see "Unable to load DLL 'sqlite3'" or similar at runtime, ensure the correct
System.Data.SQLite.Corenative dependencies are present for your platform. Installing via NuGet normally handles this. - If the table already exists,
CREATE TABLE IF NOT EXISTSaccommodates the existing database file.
See the header of Program.cs for full copyright and license terms. The source includes a permissive license statement and attribution to Tapas Pal for some of the initial code.
- To persist different sample data or to match another schema, edit
InsertDatainProgram.cs. - To change timestamp formatting, adjust the
DateTime.Now.ToString(...)format inInsertData.