>Hi,
>
>Right now I am working on a windows application project written in c#. My database is a VFP 8.0 database with some tables having an autoincrement integer datafield. In my application I use some queries to retreive some data. These queries work fine. But now I want to insert some records in my tables. How can I retreive the last generated identifier from my table?
>
>Using SQL server it can be done like this:
>BEGIN TRANSACTION
>INSERT INTO table1 (fields) VALUES(values);
>SELECT @@IDENTITY as id
>COMMIT
>
>TIA,
>
>Sander
If you do it the same way you did in SQL server sample you could call a stored proc that'd insert and return you the last id using ExecuteNonScalar.
Otherwise AFAIK there is nothing in VFP that correspond to @@IDENTITY.
I'd use GUID as a primary key rather than autoinc values. Then you could create the value and send as updatable.
Cetin