i can't figure out this strange error while i try to insert value into database
ERROR
01-01 15:48:56.065 10056-10056/com.autophone E/SQLiteLog﹕ (1) table mainTable has no column named status_date
01-01 15:48:56.100 10056-10056/com.autophone E/SQLiteDatabase﹕ Error inserting status_date=1 בינו 2000 15:48:56 problem=non model=N9005 phone_number=123 in_date=1 בינו 2000 15:48:56 status=received name=ian
android.database.sqlite.SQLiteException: table mainTable has no column named status_date (code 1): , while compiling: INSERT INTO mainTable(status_date,problem,model,phone_number,in_date,status,name) VALUES (?,?,?,?,?,?,?)
the main point it says i don't have "status_date" in the main table
but how is it possible?
public static final String KEY_ROWID = "_id";
public static final int COL_ROWID = 0;
private static final String KEY_NAME = "name";//1
private static final String KEY_MODEL = "model";//2
private static final String KEY_PHONE_NUMBER = "phone_number";//3
private static final String KEY_PROBLEM = "problem";//4
private static final String KEY_STATUS = "status";//5
private static final String KEY_IN_DATE = "in_date";//6
private static final String KEY_STATUS_DATE = "status_date";//7
public static final String DATABASE_NAME = "MyDb";
public static final String DATABASE_TABLE = "mainTable";
public static final int DATABASE_VERSION = 1;
private static final String DATABASE_CREATE_SQL =
"create table " + DATABASE_TABLE
+ " (" + KEY_ROWID + " integer primary key autoincrement, "
+ KEY_NAME + " text not null, "
+ KEY_MODEL + " text not null, "
+ KEY_PHONE_NUMBER + " text not null, "
+ KEY_PROBLEM + "text not null, "
+ KEY_STATUS + "text not null, "
+ KEY_IN_DATE + "text not null, "
+ KEY_STATUS_DATE + "text not null "
+");";
here it is...
this is the enter part
long newID=myDB.insertRow(new LogEntery("ian","N9005","123","non"));
logentery is a class i use that also adds the rest for the data
public LogEntery(String name,String model,String phone_number,String problem)
{
super();
this.name=name;
this.model=model;
this.phone_number=phone_number;
this.problem=problem;
this.in_date = DateFormat.getDateTimeInstance().format(new Date());
this.status_date = DateFormat.getDateTimeInstance().format(new Date());
this.status = "received";
}
by the way... how do i change getDateTimeInstance to get DD/MM/YYYY only and not the full data/time?