//—– OPEN DATABASE —– Connection1 = new System.Data.SQLite.SQLiteConnection("data source=" + MyDatabaseFilePath); Connection1.SetPassword(SQLITE_DATABASE_FILE_PASSWORD); Connection1.Open();
Category: Database
Create New Database
Create Database File Example using System.IO; using System.Windows.Forms; namespace MyProjectNamespace { class DatabaseSqlite { const string SQLITE_DATABASE_FILE_PASSWORD = "add_my_password_here"; //Set as "" for no password //************************************* //************************************* //********** CREATE DATABASE ********** //************************************* //************************************* bool CreateDatabase () { String FilePath; System.Data.SQLite.SQLiteConnection Connection1 = null; try { //—– CHECK DIRECTORY EXISTS —– if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + […]