1

This is logcat.

11-14 11:38:28.915  30243-30243/com.example.multical E/SQLiteLog﹕ (1) **no such column: isu**
11-14 11:38:28.925  30243-30243/com.example.multical E/AndroidRuntime﹕ **FATAL EXCEPTION: main**
Process: com.example.multical, PID: 30243
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.multical/com.example.multical.grade}: **android.database.sqlite.SQLiteException: no such column: isu (code 1): , while compiling: SELECT _id, subject, semester, credit, grade, isu FROM mygrades ORDER BY _id DESC**

Caused by: android.database.sqlite.SQLiteException: no such column: isu (code 1): , while compiling: SELECT _id, subject, semester, credit, grade, isu FROM mygrades ORDER BY _id DESC
                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

**at com.example.multical.DBAdapter.getAllInfo(DBAdapter.java:88)
        at com.example.multical.grade.onCreate(grade.java:81)**

com.example.multical.DBAdapter.getAllInfo(DBAdapter.java:88) source

Cursor c = db.query(TABLE_NAME, new String[]{ID, SUBJECT, SEMESTER, CREDIT, GRADE, ISU}, null, null, null,null, ID + " DESC");

com.example.multical.grade.onCreate(grade.java:81)**

    mInfo = mDb.getAllInfo();

and DBAdapter vairables

private static final String DB_NAME = "mygrade.db";
private static final int VERSION = 1;
public static Cursor cursor;
private static final String ID = "_id";
private static final String SUBJECT = "subject";
private static final String SEMESTER = "semester";
private static final String GRADE = "grade";
private static final String ISU = "isu";
private static final String CREDIT = "credit";
private static final String TABLE_NAME = "mygrades";
public static int count;
private static final String CREATE_TABLE =
    "CREATE TABLE " + TABLE_NAME + " (" +
    ID + " integer primary key autoincrement, " +
            SUBJECT + " text not null, " +
            SEMESTER + " text not null," + CREDIT +" text not null, " + GRADE +" text not null, " + ISU + " text not null );";

Maybe, I think that Cursor c = db.query(TABLE_NAME, new String[]{ID, SUBJECT, SEMESTER, CREDIT, GRADE, ISU}, null, null, null,null, ID + " DESC"); has happend. what's wrong that??? please help me would be appreciated. TT

1
  • @Johnmin This is possible if you alter your table structure and the old table in database does n't changed. To change it you have to increment the DB version or you have to clear the old data Commented Nov 14, 2015 at 5:18

1 Answer 1

2

First uninstall app and then reinstall app. Or you can change database version 1 to 2. It may helpful to you.

Sign up to request clarification or add additional context in comments.

1 Comment

OH!! Thank you. As a result of Chaning database version 2 , This app runs well. Thank you very much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.