Ejemplo n.º 1
0
        internal static SQLiteConnection CreateConnection(cDbInfo dbInfo)
        {
            SQLiteConnection c = new SQLiteConnection(SQL.CreateConnectionString(dbInfo).ConnectionString);

            c.Flags = System.Data.SQLite.SQLiteConnectionFlags.AllowNestedTransactions;
            return(c);
        }
Ejemplo n.º 2
0
        internal static SQLiteConnectionStringBuilder CreateConnectionString(cDbInfo dbInfo)
        {
            SQLiteConnectionStringBuilder c = new SQLiteConnectionStringBuilder();

            c.DataSource = dbInfo.IP;
            c.Password   = dbInfo.Password;
            return(c);
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 public SQL(cDbInfo dbInfo)
 {
     m_dbInfo     = dbInfo;
     m_connection = SQL.CreateConnection(dbInfo);
 }