z183052114
z183052114
2017-03-21 07:06

sqlite 报错 no such column,请问错在哪?

  • sqlite

String sqlcar = "create table if not exists cardinformation(id integer primary key autoincrement not null, name varchar, sno varchar," +
"gender varchar, department varchar, cardCode varchar, state varchar, imgUrl varchar,img BLOB)";
db.execSQL(sqlcar);

                                ContentValues values = new ContentValues();
        ByteArrayOutputStream os = new ByteArrayOutputStream();
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
            values.put("img", os.toByteArray());
        String[] arr= new String[1];
        arr[0] = strings[1];

    long i =    WelcomeActivity.db.update("cardinformation",values,"cardCode = ?",arr);



             Caused by: android.database.sqlite.SQLiteException: no such column: img (code 1): , while compiling: UPDATE cardinformation SET img=? WHERE cardCode = ?
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答