Command Builder Help

2004-07-26
2004-07-26
  • Nobody/Anonymous

    my code:

    IDbConnection conn = new SQLiteConnection();
    conn.ConnectionString = "Data Source=somefile;New=True;Compress=True;Synchronous=Off";
    conn.Open();
    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;
    dt.Rows.Add(dr);
    da.Update(ds);

    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?

     
    • Alexander Gavrilov

      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 - 2004-07-26

        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.

         
    • Nobody/Anonymous

      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.....

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks