Hi I am very new to android please help me i am not able to solve this error
Here is logcat error
android.database.sqlite.SQLiteException: no such column: datename (code 1):
, while compiling: select productinserted from mbudgettable where datename=?
THIS IS THE LINE WHERE SHOWING THE ERROR IN THE LOGCAT-
www.monthlybudget.suyash.DatabaseHandler.tproduct(DatabaseHandler.java:152)
LINES IN THE DATABASE ACTIVITY-
151 String query = "select "+productinserted+" from " + tablename + " where datename="; line 152 Cursor cursor = db.rawQuery(query, new String[] {sto});
THIS IS HOW I CREATED DATABASE-
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_TABLE = "CREATE TABLE " + tablename + "("+KEY_ID + "INTEGER PRIMARY KEY,
" + budgetinserted +" double, " +productinserted + " TEXT, " +amountinserted + " double,
" +todayproductinserted + " TEXT," + todayamountinserted + " double, " + monthlyproductinserted + " string,
" +monthlyamountinserted + " double, " + yearlybudgetinserted + "double, " + datename + "LONG, " + monthyear + "LONG);";
db.execSQL(CREATE_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + tablename);
onCreate(db);
}
PLEASE HELP ME GUYS-