Hi, I am trying to return the value of the auto increment field.
I am using the design time installation of system.data.sqlite in vs2005 with c#.
I have a table adapter which is inserting into a households table. In the dataset designer I have set the autoincrement seed and step of the households datatable to -1,-1 as recommended by microsoft. I have changed the default insert statement to
insert into housholds (street,town,postcode) values (@street,@town,@postcode);select last_insert_rowid() as householdno;
When i create a new household row and then call householdsdataAdapter.Update(householdRow) the row is inserted into the database but the householdno property of the household row is never updated with the newly created id value. I need to retrieve this value to insert child rows into another table.
I have been able to get it to work by creating a new insert query and calling executescaler but it means i have to supply all the parameters. I want to be able to call householdstableadapter.update(hosueholdrow) and the new row will contain the updated id from the database.
Do I have to handle the rowupdated event in the same mannor microsoft recommends for the jet 2.0 provider at the link below.
http://msdn.microsoft.com/en-us/library/ks9f57t0(VS.71).aspx
Thanks
Ben.