I have added a strongly-typed Database (MySQl) to a C# (.net 3.5) project. The database (DB.Electrophysiology_Data) has several relational tables but basically I want to add a new 'filesRow' to the 'files' table. I use something like the following code.
DB.Electrophysiology_Data.filesRow new_file = ds.files.NewfilesRow();
...set the values for the new_file (eg, filename, creationdate etc)
ds.files.AddfilesRow(new_file);
..eventually I update the Database via a DataAdaptor
file_adaptor.Update(ds.files)
The problem is that the AutoIncrement column (FileID) is set to -1. After closing my applicaiton and restarting, I see the new filesRow is added to the Database ok and now has an appropriate FileID value (about 5000, since I have about this many rows already in the files DataTable).
Is there a way of knowing the FileID value set by the database using the Strong-typed Database objects (DataSet, DataTable etc).
Thanks for any help, pete