0

there seems to be some problem with the insert statement in my code it is causing my application to shut down can anyone tell me Why?

    public void insert(String clas,String sub,String name)

 {
    Log.i("inserted","one Record");

        ContentValues values = new ContentValues();
        values.put(AttendAppDbOpenHelper.COLUMN_NAME,name);

        values.put(AttendAppDbOpenHelper.COLUMN_SUBJECT,sub);
        values.put(AttendAppDbOpenHelper.COLUMN_CLASS, clas );

        // Inserting Row
      database.insert(AttendAppDbOpenHelper.TABLE_DETAILS, null, values);
        DBHELPER.close(); // Closing database connection
  }
1
  • its entering this method Commented Apr 14, 2014 at 16:56

1 Answer 1

1
          public void insertFriendList(String clas,String sub,String name) {

    SQLiteDatabase slb = this.getWritableDatabase();
    ContentValues values = new ContentValues();
            values.put(AttendAppDbOpenHelper.COLUMN_NAME,name);

            values.put(AttendAppDbOpenHelper.COLUMN_SUBJECT,sub);
            values.put(AttendAppDbOpenHelper.COLUMN_CLASS, clas );
    slb.insert(AttendAppDbOpenHelper.TABLE_DETAILS, null, values);
    slb.close();
}

try this hope this may helps you

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

Comments

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.