RuntimeError while retriving data from sqlite database in android

前端 未结 4 1684
情深已故
情深已故 2021-01-27 01:31

I\'m trying to insert and retrieve data from database in eclipse using sqlite, but it shows a RuntimeError. I create a layout with three edit texts and one button t

4条回答
  •  孤城傲影
    2021-01-27 01:52

    Also fixe this

    public void onCreate(SQLiteDatabase db) {
            data=db;
            db.execSQL("CREATE TABLE " + TABLE_NAME + " ("
                    + NAME + " TEXT,"
                    + FATHER_NAME + " TEXT,"
                    + MOTHER_NAME + " TEXT"
                    + ");");
            Log.d("DATABASE OPERATION", "TABLE CREATED");
    
    
        }
    

    for "INTEGER," remove ,.

    and intialise it like this DBHelper.

    DBHelper DB=new DBHelper(MainActivity.this);
    

提交回复
热议问题