Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
androidsqlite动态插入查询_Android_Sqlite - Fatal编程技术网

androidsqlite动态插入查询

androidsqlite动态插入查询,android,sqlite,Android,Sqlite,如何在DBAdapter中插入查询?这是我的sql插入查询。它可以在运行时创建字段和值。然后需要执行 这是我的代码: public void insertTableRecord(String strTableName, String strToFields, String strValues){ String Sql = "Insert into " + strTableName + "(" + strToFields + ") Values (" + strValues + "

如何在DBAdapter中插入查询?这是我的sql插入查询。它可以在运行时创建字段和值。然后需要执行

这是我的代码:

  public void insertTableRecord(String strTableName, String strToFields, String strValues){
     String Sql = "Insert into " + strTableName + "(" + strToFields + ") Values (" + strValues + " )";
     DBAdapter dbAdapter = DBAdapter.getDBAdapterInstance(DownlaodTableActivity.this);
     dbAdapter.openDataBase();

     ContentValues initialValues = new ContentValues();
    //initialValues.put("how to give", ??how to give);
    long n = dbAdapter.insertRecordsInDB(strTableName, null, initialValues);
}
请告诉我怎么做这个部分

请帮帮我


提前感谢..

尝试
initialValues.put(strofields,strValue)