示例#1
0
 private bool InitDatabase()
 {
     CloseDatabase();
     bool result = false;
     try
     {
         _dbcon = new DBConComSqlite(DatabaseFilename);
         object o = _dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='images'");
         if (o == null || o.GetType() == typeof(DBNull))
         {
             _dbcon.ExecuteNonQuery("create table 'images' (org_url text, gccode text, local_file text)");
             _dbcon.ExecuteNonQuery("create index idx_images on images (org_url)");
         }
         result = true;
     }
     catch
     {
     }
     return result;
 }
示例#2
0
 private void CloseDatabase()
 {
     if (_dbcon != null)
     {
         _dbcon.Dispose();
         _dbcon = null;
     }
 }