in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

code sample showing how to perform a dataset Update and retrieve the auto-increment IDs???

Last post 10-21-2009 11:20 PM by callagga. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-21-2009 8:39 PM

    code sample showing how to perform a dataset Update and retrieve the auto-increment IDs???

    Hi,

    Does anyone have a code sample showing how to perform a datasetup Update and retrieve the primary key ID's that sqlite generates for the auto-increment field?     I can't quite see/work out how to do this.  

     For example at the moment I'm getting the following error, which I think may be due to this

    private SQLiteDataAdapter DA_Webfiles;
    // Setup connection, fill dataset etc

    DataTable dt = this.dataSet.Tables["WEBFILES"];
    DataRow newRow = dt.NewRow();
    newRow
    ["PATH"] = _url;
    dt
    .Rows.Add(newRow);
    this.DA_Webfiles.Update(this.dataSet, "WEBFILES");
    // Works to Here

    newRow
    ["CONTENT_TYPE"] = "Test Content Type";
    this.DA_Webfiles.Update(this.dataSet, "WEBFILES");
    // Get ERROR here - Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
  • 10-21-2009 11:20 PM In reply to

    Re: code sample showing how to perform a dataset Update and retrieve the auto-increment IDs???

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems