using System.Data.SQLite; // ... string connectionString = @"Data Source=C:\sqlite\db\test.db"; using var connection = new SQLiteConnection(connectionString); connection.Open(); using var command = new SQLiteCommand("SELECT COUNT(*) FROM products", connection); int productCount = (int)command.ExecuteScalar(); Console.WriteLine($"There are {productCount} products.");In the above example, we first establish a connection to a SQLite database using a connection string. We then create an SQLiteCommand object that executes a SELECT COUNT(*) query against a "products" table. Finally, we call the ExecuteScalar method to fetch the query result and convert it to an integer. The System.Data.SQLite package library is a .NET data provider for SQLite that allows developers to easily integrate SQLite databases into their .NET applications.