jeudi 19 février 2015

Android: column not found

i'm making my first steps with android and databases. at the moment i have the problem that android keeps telling me that my column doesn't exist and i don't know why.


E/SQLiteLog﹕ (1) table positions has no column named latitude


This is where i create my Database



SQLiteDatabase myDB = null;
try{
myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE + " (ID integer primary key autoincrement,name varchar(255),longitude long,latitude long)");
}


And this is where i'm trying to add my datas



myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);

ContentValues values = new ContentValues();
values.put("name", name);
values.put("longitude",longi);
values.put("latitude",lati);

myDB.insert(MY_DB_TABLE,null,values);
myDB.close();


Hoping to find some help :/


Aucun commentaire:

Enregistrer un commentaire