Command Builder Help

  • my code:

    IDbConnection conn = new SQLiteConnection();
    conn.ConnectionString = "Data Source=somefile;New=True;Compress=True;Synchronous=Off";
    SQLiteDataAdapter da = new SQLiteDataAdapter("select * from sometable",conn);
    SQLiteCommandBuilder cb = new SQLiteCommandBuilder(da);
    DataSet ds = new DataSet();
    da.Fill (ds);
    DataTable dt = ds.Tables[0];
    DataRow dr = dt.NewRow();
    dr[0] = somevalue;

    The table is created by the open command but the data is not updated by the update command - can you see anything wrong with the code?

    • I don't see anything wrong with this code. It could be something with the table. Can you post the actual CREATE TABLE statement for 'sometable'?

      • Brad Stiles
        Brad Stiles

        If the database is being created with the "New" paramter, does the table referenced in the select statement actually exist?  Or am I missing something about this problem?  I don't understand how "The table is created by the open command" here.

    • Well, I don't know what I had wrong - but it is working now. Thanks for the replies. Now if there was a way to update the 80,000 rows faster.....