public override void OnCreate(SQLiteDatabase paramSQLiteDatabase)
        {
            // Create table "wikinotes"
            paramSQLiteDatabase.ExecSQL("CREATE TABLE " + WikiNote.Notes.TABLE_WIKINOTES + " (" + WikiNote.Notes.Id + " INTEGER PRIMARY KEY,"
                + WikiNote.Notes.TITLE + " TEXT COLLATE LOCALIZED NOT NULL,"
                + WikiNote.Notes.BODY + " TEXT,"
                + WikiNote.Notes.CREATED_DATE + " INTEGER,"
                + WikiNote.Notes.MODIFIED_DATE + " INTEGER" + ");");

            // Initialize database
            ContentValues localContentValues = new ContentValues();
            localContentValues.Put(WikiNote.Notes.TITLE, this._context.Resources.GetString(Resource.String.start_page));
            localContentValues.Put(WikiNote.Notes.BODY, this._context.Resources.GetString(Resource.String.top_note));
            long localLong = DateTime.Now.ToFileTimeUtc();
            localContentValues.Put(WikiNote.Notes.CREATED_DATE, localLong);
            localContentValues.Put(WikiNote.Notes.MODIFIED_DATE, localLong);

            paramSQLiteDatabase.Insert(WikiNote.Notes.TABLE_WIKINOTES, "huh?", localContentValues);

            localContentValues.Put(WikiNote.Notes.TITLE, "PageFormatting");
            localContentValues.Put(WikiNote.Notes.BODY, this._context.Resources.GetString(Resource.String.page_formatting_note));
            localContentValues.Put(WikiNote.Notes.CREATED_DATE, localLong);
            localContentValues.Put(WikiNote.Notes.MODIFIED_DATE, localLong);

            paramSQLiteDatabase.Insert(WikiNote.Notes.TABLE_WIKINOTES, "huh?", localContentValues);
        }
		public void CreateDatabase(string sqldb_name)
		{
			try
			{
				sqldb_message = "";
				string sqldb_location = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
				string sqldb_path = Path.Combine(sqldb_location,sqldb_name);
				bool sqldb_exists = File.Exists(sqldb_path);
				if(!sqldb_exists)
				{
					
					sqldb = SQLiteDatabase.OpenOrCreateDatabase(sqldb_path,null);
					sqldb_query = "CREATE TABLE IF NOT EXISTS Contact (_id INTEGER PRIMARY KEY AUTOINCREMENT, FirstName VARCHAR, LastName VARCHAR, " +
						"Phone VARCHAR, Photo VARCHAR);";
					sqldb.ExecSQL(sqldb_query);
					sqldb_message = "Database:"+sqldb_name+" created";
				}
				else
				{
					sqldb = SQLiteDatabase.OpenDatabase(sqldb_path,null,DatabaseOpenFlags.OpenReadwrite);
					sqldb_message = "Database:"+sqldb_name+" opened";
				}
				sqldb_available=true;
			}
			catch(SQLiteException ex)
			{
				sqldb_message = ex.Message;
			}
		}   
Beispiel #3
0
		public override void OnUpgrade(SQLiteDatabase db, int oldV, int newV)
		{
			//base.OnUpgrade (db, oldV, newV);
			// Drop older table if existed
			db.ExecSQL("DROP TABLE IF EXISTS " + TABLE_QUEST);
			// Create tables again
			OnCreate(db);
		}
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(CREATE_SERVER_TABLE);
     db.ExecSQL(CREATE_GROUP_TABLE);
     db.ExecSQL(DEFAULT_GROUP);
     // Demo data
     //db.execSQL(ADD_SERVER);
 }
Beispiel #5
0
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"
     CREATE TABLE MapLocation (
       ID INTEGER PRIMARY KEY AUTOINCREMENT,
       Longitude FLOAT NOT NULL,
       Latitude FLOAT NOT NULL
     )");
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"
             CREATE TABLE Note (
                 Id INTEGER PRIMARY KEY AUTOINCREMENT,
                 Title TEXT NOT NULL,
                 Contents TEXT NOT NULL
             )");
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"
         CREATE TABLE " + DATABASE_TABLE_NAME + " ("
             + _ID + " TEXT PRIMARY KEY NOT NULL,"
             + NAME + " TEXT NOT NULL,"
             + LONGITUDE + " REAL NOT NULL,"
             + LATITUTDE + " REAL NOT NULL)"
             );
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"
         CREATE TABLE " + DATABASE_TABLE_NAME + " ("
             + _ID + " INTEGER PRIMARY KEY NOT NULL," // INTEGER PRIMARY KEY functions as auto increment in SQLite
             + NAME + " TEXT NOT NULL,"
             + LONGITUDE + " REAL NOT NULL,"
             + LATITUTDE + " REAL NOT NULL)"
             );
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"
         CREATE TABLE history (
             _id INTEGER PRIMARY KEY AUTOINCREMENT,
             Title TEXT NOT NULL,
             Url TEXT NOT NULL,
             Timestamp INT NOT NULL
         )
         ");
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(create_table_sql);
     // seed with data
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Vegetables')");
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Fruits')");
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Flower Buds')");
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Legumes')");
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Bulbs')");
     db.ExecSQL("INSERT INTO vegetables (name) VALUES ('Tubers')");
 }
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     // This database is only a cache for online data, so its upgrade policy is
     // to simply to discard the data and start over
     // Note that this only fires if you change the version number for your database.
     // It does NOT depend on the version number for your application.
     // If you want to update the schema without wiping data, commenting out the next 2 lines
     // should be your top priority before modifying this method.
     db.ExecSQL ("DROP TABLE IF EXISTS " + WeatherContractOpen.LocationEntryOpen.TABLE_NAME);
     db.ExecSQL ("DROP TABLE IF EXISTS " + WeatherContractOpen.WeatherEntryOpen.TABLE_NAME);
     OnCreate (db);
 }
Beispiel #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.groupadd);

            YastroidOpenHelper helper = new YastroidOpenHelper(this);
            database = helper.WritableDatabase;

            addButton = FindViewById<Button>(Resource.Id.button_add_group);

            addButton.Click += OnClickedHandler;
        }
Beispiel #13
0
		public override void OnCreate(SQLiteDatabase db)
		{
			//base.OnCreate (db);
			dbase=db;
			string sql = "CREATE TABLE IF NOT EXISTS " + TABLE_QUEST + " ( "
				+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_QUES
				+ " TEXT, " + KEY_ANSWER+ " TEXT, "+KEY_OPTA +" TEXT, "
				+KEY_OPTB +" TEXT, "+KEY_OPTC+" TEXT)";
			db.ExecSQL(sql);		
			addQuestions();
			//db.close();
		}
Beispiel #14
0
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(create_table_sql);
     // seed with data
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
     //			db.ExecSQL("INSERT INTO RUOKData (date_time, ergebnis) VALUES ('11.06.82 13:30', 25)");
 }
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     Log.Warn (TAG, "Upgrading database from version " + oldVersion + "to " + newVersion);
     // Any changes to the database structure should occur here.
     // This is called if the DATABASE_VERSION installed is older
     // than the new version.
     // ie. db.execSQL("alter table " + TASKS_TABLE + " add column " +
     // TASK_ADDRESS + " text");
     //db.execSQL("ALTER TABLE servers ADD COLUMN grp INTEGER;");
     //db.execSQL(CREATE_GROUP_TABLE);
     //db.execSQL(DEFAULT_GROUP);
     //db.execSQL("UPDATE " + SERVERS_TABLE_NAME + " SET " + SERVERS_GROUP + "='" + GROUP_DEFAULT_ALL + "';");
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(
         string.Format(@"
             CREATE TABLE {0} (
                 {1} integer primary key autoincrement,
                 {2} text not null,
                 {3} text not null
             )",
             NoteDatabaseConstants.TableName,
             NoteDatabaseConstants.IdColumn,
             NoteDatabaseConstants.TitleColumn,
             NoteDatabaseConstants.ContentColumn
         ));
 }
        private bool saveServer()
        {
            database = dbhelper.WritableDatabase;
            bool result = false;
            try {

                URI uri = new URI(FindViewById<EditText>(Resource.Id.edit_server_host).Text);
                string name = FindViewById<EditText>(Resource.Id.edit_server_name).Text;
                string scheme = null;
                string host = uri.Host;
                string port = FindViewById<EditText>(Resource.Id.edit_server_port).Text;
                string user = FindViewById<EditText>(Resource.Id.edit_server_user).Text;
                string pass = FindViewById<EditText>(Resource.Id.edit_server_pass).Text;

                if (uri.Scheme == null) {
                    scheme = "http";
                    host = uri.SchemeSpecificPart;
                } else {
                    scheme = uri.Scheme;
                }

                        if (name.Length == 0 || host.Length == 0 || port.Length == 0 || user.Length == 0) {
                            Toast.MakeText(this, "One or more fields are empty", ToastLength.Short).Show();
                    return false;
                }

                ContentValues values = new ContentValues();
                values.Put(YastroidOpenHelper.SERVERS_NAME, name);
                values.Put(YastroidOpenHelper.SERVERS_SCHEME, scheme);
                values.Put(YastroidOpenHelper.SERVERS_HOST, host);
                values.Put(YastroidOpenHelper.SERVERS_PORT, port);
                values.Put(YastroidOpenHelper.SERVERS_USER, user);
                if(pass.Length == 0 )
                    values.Put(YastroidOpenHelper.SERVERS_PASS, s.getPass());
                else
                    values.Put(YastroidOpenHelper.SERVERS_PASS, pass);
                    values.Put(YastroidOpenHelper.SERVERS_GROUP, s.getGroupId());

                database.Update(YastroidOpenHelper.SERVERS_TABLE_NAME, values, YastroidOpenHelper.SERVERS_ID + "=" + s.getId(), null);
                        database.Close();
                        Log.Info("ARRAY", "WebYaST server " + name + " has been updated.");
                result = true;
            } catch (Exception e) {
                            Log.Error("BACKGROUND_PROC", e.Message);
            }
                        Toast.MakeText(this, "Server Updated", ToastLength.Short).Show();
            return result;
        }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(create_table_sql);
     // seed with data
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Adam Strange', 'Adam Strange is the human champion of the alien planet Rann, an archaeologist who fights monsters using a jet pack and ray gun')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Alfred Pennyworth', 'Alfred Pennyworth is the British butler and valet to the Wayne Family. He took up the role of legal guardian of Bruce Wayne after the murder of Thomas and Martha Wayne')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Amanda Waller', 'Amanda The Wall Waller is a hardline top-ranking U.S. Government agent involved in clandestine operations')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Amazo', 'Amazo is a robotic enemy of the Justice League of America, a deadly android designed by the mad scientist Professor Ivo')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Bane', 'Bane is a brilliant world-class fighter and tactical genius who augments his great physical strength with a steroid called venom')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Batman', 'Batman is the super-hero protector of Gotham City, a man dressed like a bat who fights against evil and strikes terror into the hearts of criminals everywhere')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Superman', 'Superman, also known as the Man of Steel, is one of the most powerful superheroes in the DC Universe. His abilities include incredible super-strength, super-speed, invulnerability, freezing breath, flight, and heat-vision')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Animal Man', 'Animal Man is a super-hero who can use the abilities of any animal. His powers are gained from tapping into the morphogenic field known as The Red, giving him the power of any animal on the planet and sometimes the universe')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Anti-Monitor', 'The Anti-Monitor is a supremely powerful being who controls the Antimatter Universe, acting as an evil counterpart to his brother the Monitor')");
     db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('Aqualad', 'Aqualad, also known as Garth is Aquamans teenage sidekick. As an adult he took the name Tempest. He is a member of the Aquaman Family along with other side-kicks including Aquagirl and Dolphin')");
     //db.ExecSQL("INSERT INTO Superheroes (name, description) VALUES ('', '')");
 }
        //@Override
        public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
        {
            //Log.w(TAG, "Upgrading application's database from version " + oldVersion
            //        + " to " + newVersion + ", which will destroy all old data!");

            int version = oldVersion;
            if (version == 1)
            {
                version = 2;
            }
            if (version != DATABASE_VERSION)
            {
                // Drop the old tables.
                db.ExecSQL("DROP TABLE IF EXISTS " + Table_SCORECARD);
                // Recreate new database.
                OnCreate(db);
            }
        }
        private void getServer(long serverId)
        {
            database = dbhelper.ReadableDatabase;
            ICursor sc;
            try {
                sc = database.Query(YastroidOpenHelper.SERVERS_TABLE_NAME, new string[] {
                            "_id", "name", "scheme", "hostname", "port", "user", "pass", "grp" },
                    YastroidOpenHelper.SERVERS_ID + "=" + serverId, null, null, null, null);

                sc.MoveToFirst();
                s = new Server(sc.GetInt(0), sc.GetString(1), sc.GetString(2), sc
                    .GetString(3), sc.GetInt(4), sc.GetString(5), sc
                                .GetString(6), sc.GetInt(7));
                sc.Close();
                database.Close();
            } catch (Exception e) {
                Log.Error("BACKGROUND_PROC", e.Message);
            }
        }
        public override void OnCreate(SQLiteDatabase db)
        {
            const string SQL_CREATE_WEATHER_TABLE = "CREATE TABLE " + WeatherContractOpen.WeatherEntryOpen.TABLE_NAME + " (" +
                // Why AutoIncrement here, and not above?
                // Unique keys will be auto-generated in either case.  But for weather
                // forecasting, it's reasonable to assume the user will want information
                // for a certain date and all dates *following*, so the forecast data
                // should be sorted accordingly.
                                                    WeatherContractOpen.WeatherEntryOpen._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +

                // the ID of the location entry associated with this weather data
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_LOC_KEY + " INTEGER NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_DATE + " INTEGER NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_SHORT_DESC + " TEXT NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_WEATHER_id + " INTEGER NOT NULL," +

                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_MIN_TEMP + " REAL NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_MAX_TEMP + " REAL NOT NULL, " +

                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_HUMIDITY + " REAL NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_PRESSURE + " REAL NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_WIND_SPEED + " REAL NOT NULL, " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_DEGREES + " REAL NOT NULL, " +

                // Set up the location column as a foreign key to location table.
                                                    " FOREIGN KEY (" + WeatherContractOpen.WeatherEntryOpen.COLUMN_LOC_KEY + ") REFERENCES " +
                                                    WeatherContractOpen.LocationEntryOpen.TABLE_NAME + " (" + WeatherContractOpen.LocationEntryOpen._ID + "), " +

                // To assure the application have just one weather entry per day
                // per location, it's created a UNIQUE constraint with REPLACE strategy
                                                    " UNIQUE (" + WeatherContractOpen.WeatherEntryOpen.COLUMN_DATE + ", " +
                                                    WeatherContractOpen.WeatherEntryOpen.COLUMN_LOC_KEY + ") ON CONFLICT REPLACE);";

            db.ExecSQL (SQL_CREATE_WEATHER_TABLE);

            const string SQL_CREATE_LOCATION_TABLE = "CREATE TABLE " + WeatherContractOpen.LocationEntryOpen.TABLE_NAME + " (" +
                                                     WeatherContractOpen.LocationEntryOpen._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
                                                     WeatherContractOpen.LocationEntryOpen.COLUMN_LOCATION_SETTING + " TEXT UNIQUE NOT NULL, " +
                                                     WeatherContractOpen.LocationEntryOpen.COLUMN_CITY_NAME + " TEXT NOT NULL, " +
                                                     WeatherContractOpen.LocationEntryOpen.COLUMN_COORD_LAT + " REAL NOT NULL, " +
                                                     WeatherContractOpen.LocationEntryOpen.COLUMN_COORD_LONG + " REAL NOT NULL);";
            db.ExecSQL (SQL_CREATE_LOCATION_TABLE);
        }
Beispiel #22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.serveradd);

            YastroidOpenHelper helper = new YastroidOpenHelper(this);
            database = helper.WritableDatabase;

            Intent groupIntent = Intent;
            Bundle b = groupIntent.Extras;
            groupId = b.GetInt("GROUP_ID");

            this.addButton = FindViewById<Button>(Resource.Id.button_add_server);
            this.addButton.Click += (sender, e) => {
                if (addServer ()) {
                    Finish ();
                }
            };
        }
        public void Load(MarkovFactory factory)
        {
            Log.Debug ( TAG, "Loading." );
            myDatabase = context.OpenOrCreateDatabase (DATABASE_NAME, FileCreationMode.WorldReadable, null);
            ICursor cursor = myDatabase.RawQuery ("SELECT * FROM 'words'", null);

            int firstWordIndex = cursor.GetColumnIndex("firstWord");
            int secondWordIndex = cursor.GetColumnIndex("secondWord");
            int instanceCountIndex = cursor.GetColumnIndex("instanceCount");

            string firstWord, secondWord;
            int instanceCount;

            cursor.MoveToFirst ();
            while (!cursor.IsAfterLast)
            {
                firstWord = cursor.GetString ( firstWordIndex );
                secondWord = cursor.GetString ( secondWordIndex );
                instanceCount = cursor.GetInt( instanceCountIndex );

                if (!factory.chain.ContainsKey( firstWord ) )
                {
                    MarkovWord link = new MarkovWord(firstWord);
                    factory.chain.Add( firstWord, link );
                }

                MarkovWord afterWord;

                if (!factory.chain.ContainsKey ( secondWord ) )
                {
                    afterWord = new MarkovWord ( secondWord );
                    factory.chain.Add( secondWord, afterWord );
                }

                afterWord = factory.chain[secondWord];

                factory.chain[ firstWord ].afters.Add( afterWord, instanceCount );

                cursor.MoveToNext();
            }
        }
        /// <summary>
        /// Ons the create.
        /// </summary>
        /// <param name='database'>Database.</param>
        public override void OnCreate(SQLiteDatabase database)
        {
            string sql = string.Empty;

              // create the device table
              sql = "create table " + Device.TABLE_NAME + "(";
              sql += Device.COL_ID + " text primary key,";
              sql += Device.COL_CAPTION + " text not null,";
              sql += Device.COL_TYPE + " text not null,";
              sql += Device.COL_SUBSCRIPTIONS + " int);";
              database.ExecSQL(sql);

              // create the subscription table
              sql = "create table " + Subscription.TABLE_NAME + "(";
              sql += Subscription.COL_TITLE + " text primary key,";
              sql += Subscription.COL_DESCRIPTION + " text,";
              sql += Subscription.COL_LOGO_URL + " text,";
              sql += Subscription.COL_MYGPO_LINK + " text,";
              sql += Subscription.COL_POSITION_LAST_WEEK + " int,";
              sql += Subscription.COL_SCALED_LOGO_URL + " text,";
              sql += Subscription.COL_SUBSCRIBERS + " int,";
              sql += Subscription.COL_SUBSRIBERS_LAST_WEEK + " int,";
              sql += Subscription.COL_URL + " text,";
              sql += Subscription.COL_WEBSITE + " text);";
              database.ExecSQL(sql);

              // create the episode table
              sql = "create table " + Episode.TABLE_NAME + "(";
              sql += Episode.COL_URL + " text primary key,";
              sql += Episode.COL_DESCRIPTION + " text,";
              sql += Episode.COL_MYGPO_LINK + " text,";
              sql += Episode.COL_PODCAST_TITLE + " text,";
              sql += Episode.COL_PODCAST_URL + " text,";
              sql += Episode.COL_RELEASED + " text,";
              sql += Episode.COL_STATUS + " text,";
              sql += Episode.COL_TITLE + " text,";
              sql += Episode.COL_PLAYER_POSITION + " int,";
              sql += Episode.COL_DURATION + " int,";
              sql += Episode.COL_WEBSITE + " text);";
              database.ExecSQL(sql);
        }
Beispiel #25
0
        public Server getServer(int id)
        {
            database = dbhelper.ReadableDatabase;
            Server s = null;
            try {
                ICursor sc = database.Query(YastroidOpenHelper.SERVERS_TABLE_NAME,
                        new string[] { "_id", "name", "scheme", "hostname", "port",
                                "user", "pass", "grp" }, "_id="+id, null, null, null, null);

                if(sc.Count == 1) {
                    s = new Server(sc.GetInt(0), sc.GetString(1), sc
                                .GetString(2), sc.GetString(3), sc.GetInt(4), sc
                                .GetString(5), sc.GetString(6), sc.GetInt(7));
                    }
                sc.Close();
                database.Close();
            } catch (Exception e) {
                Log.Error("BACKGROUND_PROC", e.Message);
            }
            return s;
        }
 /// <summary>
 /// Ons the upgrade.
 /// </summary>
 /// <param name='db'>Db.</param>
 /// <param name='oldVersion'>Old version.</param>
 /// <param name='newVersion'>New version.</param>
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     Log.Warn(GetType().Name,"Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data");
       db.ExecSQL("DROP TABLE IF EXISTS " + Device.TABLE_NAME);
       db.ExecSQL("DROP TABLE IF EXISTS " + Subscription.TABLE_NAME);
       db.ExecSQL("DROP TABLE IF EXISTS " + Episode.TABLE_NAME);
       OnCreate(db);
 }
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     // not
     throw new NotImplementedException();
 }
Beispiel #28
0
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     // not required until second version :)
     throw new NotImplementedException();
 }
 public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
 {
     //Nothing todo here since this is the first version of the database
 }
 public override void OnCreate(SQLiteDatabase db)
 {
     db.ExecSQL(@"CREATE TABLE Task(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, description TEXT, done INTEGER);");
 }