LitDev.DataBase.ConnectSQLite C# (CSharp) Метод

ConnectSQLite() публичный Метод

public ConnectSQLite ( ) : void
Результат void
        public void ConnectSQLite()
        {
            dbType = DBType.SQLite;
            dbConnection = "Data Source=" + database;
            if (LDDataBase.Connection != "") dbConnection = LDDataBase.Connection;
            cnnSQLite = new SQLiteConnection(dbConnection);
            cnnSQLite.Open();
            commandSQLite = new SQLiteCommand();
            commandSQLite.Connection = cnnSQLite;
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Create or open an SQLite database.
 /// This must be called before any SQL methods.
 /// When a table is created it must have first column as "Id INTEGER PRIMARY KEY".
 /// </summary>
 /// <param name="fileName">The full path to the SQLite database file (usually with extension db).</param>
 /// <returns>A label to identify the database.</returns>
 public static Primitive ConnectSQLite(Primitive fileName)
 {
     try
     {
         ExtractDll();
         DataBase dataBase = GetDataBase(fileName, false);
         if (null == dataBase)
         {
             dataBase = new DataBase(fileName, NextID());
             dataBase.ConnectSQLite();
         }
         dataBases.Add(dataBase);
         return(dataBase.name);
     }
     catch (Exception ex)
     {
         Utilities.OnError(Utilities.GetCurrentMethod(), ex);
     }
     return("");
 }
All Usage Examples Of LitDev.DataBase::ConnectSQLite