c# - How could I copy or Insert datatable into SQLiteDataBase? -


i using web service catch data sql server 2012 , putting datatable.i want copy or insert datatable sqlite database.i making code in c#.is there way so.

for each row in data table must like:

sqliteconnection connsqlite = new sqliteconnection(string.format("data source={0};version=3;", filepath));              connsqlite.open();                 datatable = new datatable();                 (int = 0; < a.rows.count; i++)                 {                     string rowquery = "insert tbl values(";                     (int z = 0; z < a.rows[i].itemarray.count(); z++)                     {                         rowquery+=a.rows[0].itemarray[1].tostring();                         if (z < a.rows[i].itemarray.count() - 1)                             rowquery += ",";                     }                     rowquery += ")";                 }                 sqlitecommand commsqlite = new sqlitecommand(strcommand, connsqlite);                 commsqlite.executenonquery(); 

Comments