Hx_Fish
2021-04-09 17:24
采纳率: 83.3%
浏览 222

Android使用SQLite数据库,insert没有报错但是数据也没有插入

 String PeopleName;
        PeopleName = nameEditText.getText().toString();/
        SQLiteDatabase DB = dbHelper.getWritableDatabase();
ContentValues values = new ContentValues();
        //values.put("id","1");
        //values.put("number","NumArray[i]");
        values.put("name","PeopleName");
        values.put("score","ScoreArray");
        values.put("mdate","DateArray");
        values.put("evaluate","EvaluateArray");
        DB.insert("score2",null,values);
        values.clear();//清空

public static String ShootScore2 = "create table score2("
            +"id integer primary key autoincrement,"
            +"number int,"
            +"name text,"
            +"score text,"
            +"date text,"
            +"evaluate text)";
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题