Example #1
0
 protected Table(SQLiteOpenHelper dbHelper, string tableName, IDictionary <string, StorageClass> fields)
 {
     TableName        = tableName;
     this.dbHelper    = dbHelper;
     this.fields      = fields;
     this.createQuery = GenerateCreateQuery(fields);
     this.dropQuery   = GenerateDropQuery();
 }
Example #2
0
 public void release()
 {
     if (mDBHelper != null)
     {
         mDBHelper.Close();
         mDBHelper = null;
     }
     instance = null;
 }
Example #3
0
        public MainPage()
        {
            this.InitializeComponent();


            Task.Factory.StartNew(() =>
            {
                SQLiteOpenHelper helper = new SQLiteOpenHelper();
                helper.GetWritableDatabase();
            });
        }
Example #4
0
        public SQLiteOpenHelper GetDbConnection()
        {
            var item = DBInitial.DBNameModel;

            if (item == null)
            {
                throw new ArgumentException("执行的数据库不能为空");
            }
            sQLiteOpenHelper = new SQLiteOpenHelper(item.Name, item.Path, item.Version);
            return(sQLiteOpenHelper);
        }
Example #5
0
        public void init(Context context)
        {
            if (context == null)
            {
                return;
            }

            if (mDBHelper == null)
            {
                mDBHelper = new DBHelper(context.ApplicationContext);
            }
        }
Example #6
0
 public Consumers(SQLiteOpenHelper dbHelper)
     : base(dbHelper, Table, Fields)
 {
 }
Example #7
0
 public SolarNetworks(SQLiteOpenHelper dbHelper)
     : base(dbHelper, Table, Fields)
 {
 }
Example #8
0
 public Panels(SQLiteOpenHelper dbHelper)
     : base(dbHelper, Table, Fields)
 {
 }
Example #9
0
 public static SQLiteDatabase getReadableDatabase(this SQLiteOpenHelper sqlHelper)
 {
     return(sqlHelper.ReadableDatabase);
 }