SQLite C# version
If the first program, we check the version of the SQLite database.
Program.cs
using System;
using System.Data.SQLite;
namespace Version
{
class Program
{
static void Main(string[] args)
{
string cs = "Data Source=:memory:";
string stm = "SELECT SQLITE_VERSION()";
using var con = new SQLiteConnection(cs);
con.Open();
using var cmd = new SQLiteCommand(stm, con);
string version = cmd.ExecuteScalar().ToString();
Console.WriteLine($"SQLite version: {version}");
}
}
}
using System.Data.SQLite;
namespace Version
{
class Program
{
static void Main(string[] args)
{
string cs = "Data Source=:memory:";
string stm = "SELECT SQLITE_VERSION()";
using var con = new SQLiteConnection(cs);
con.Open();
using var cmd = new SQLiteCommand(stm, con);
string version = cmd.ExecuteScalar().ToString();
Console.WriteLine($"SQLite version: {version}");
}
}
}