using System.Data.SQLite; string connectionString = "Data Source=c:\\demo.db;Version=3;"; SQLiteConnection connection = new SQLiteConnection(connectionString); connection.Open();
using System.Data.SQLite; string connectionString = "Data Source=c:\\demo.db;Version=3;"; SQLiteConnection connection = new SQLiteConnection(connectionString); if (connection.State != System.Data.ConnectionState.Open) connection.Open();This code checks if the connection to the demo.db database located in the C: drive is open and opens the connection if it is closed. The package library used is System.Data.SQLite.