internal static SQLiteConnection CreateConnection(cDbInfo dbInfo) { SQLiteConnection c = new SQLiteConnection(SQL.CreateConnectionString(dbInfo).ConnectionString); c.Flags = System.Data.SQLite.SQLiteConnectionFlags.AllowNestedTransactions; return(c); }
internal static SQLiteConnectionStringBuilder CreateConnectionString(cDbInfo dbInfo) { SQLiteConnectionStringBuilder c = new SQLiteConnectionStringBuilder(); c.DataSource = dbInfo.IP; c.Password = dbInfo.Password; return(c); }
public eConnectionStatus ConnectionTest(cDbInfo dbInfo) { try { SQLiteConnection c = new SQLiteConnection(SQL.CreateConnectionString(dbInfo).ConnectionString); c.Open(); if (c.State == System.Data.ConnectionState.Open) { c.Close(); return(eConnectionStatus.OK); } } catch (SQLiteException e) { return(eConnectionStatus.ERROR); } return(eConnectionStatus.ERROR); }
public SQL(cDbInfo dbInfo) { m_dbInfo = dbInfo; m_connection = SQL.CreateConnection(dbInfo); }