Skip to content

A short program to demonstrate technique for converting TaskSchedulerOneTimeSealevel from MS SQL Server to SQLite.

Notifications You must be signed in to change notification settings

ep5org/SQLiteTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SQLite Demo — TaskSchedulerOneTimeSealevel

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.

Key details

  • 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).

Prerequisites

  • .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.

If using Visual Studio, ensure the project Target Framework is set to .NET 10 under Project Properties.

Build and run (CLI)

  1. Restore and add the package (if not already added):
    • dotnet restore
    • dotnet add package System.Data.SQLite.Core
  2. Build:
    • dotnet build
  3. Run:
    • dotnet run --project <path-to-project>

When run, the program:

  • Creates (or opens) TaskSchedulerOneTimeSealevel.db in the current working directory.
  • Creates the ControlEvent table.
  • Inserts four sample records.
  • Reads and prints each record to the console.

Where the database is created

The SQLite file TaskSchedulerOneTimeSealevel.db is created in the process working directory (typically the project output / project root when using dotnet run).

Configuration notes

  • 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.

Troubleshooting

  • If you see "Unable to load DLL 'sqlite3'" or similar at runtime, ensure the correct System.Data.SQLite.Core native dependencies are present for your platform. Installing via NuGet normally handles this.
  • If the table already exists, CREATE TABLE IF NOT EXISTS accommodates the existing database file.

License / Attribution

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.

Useful edits

  • To persist different sample data or to match another schema, edit InsertData in Program.cs.
  • To change timestamp formatting, adjust the DateTime.Now.ToString(...) format in InsertData.

About

A short program to demonstrate technique for converting TaskSchedulerOneTimeSealevel from MS SQL Server to SQLite.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages