M
Mr Newbie
Hi Guys,
Im writing an application presently and I need to create new SQL Records.
The problem is I want to know the last record ID number which I inserted.
The way I have it set up presently is that I set the ID in the DataTable
to -1 this ensures I get a unique ID on the server, however, I have also
generated a set or records in a relation in another DataTable which need to
be inserted into the SQL Database as well.
Does anyone know the correct or best way to acheive this, because I cant
write my related table until I know what ID my new master record has.
Also, the method has to be 100% reliable as this sytem will have multiple
users.
Regards and hope someone can help.
Im writing an application presently and I need to create new SQL Records.
The problem is I want to know the last record ID number which I inserted.
The way I have it set up presently is that I set the ID in the DataTable
to -1 this ensures I get a unique ID on the server, however, I have also
generated a set or records in a relation in another DataTable which need to
be inserted into the SQL Database as well.
Does anyone know the correct or best way to acheive this, because I cant
write my related table until I know what ID my new master record has.
Also, the method has to be 100% reliable as this sytem will have multiple
users.
Regards and hope someone can help.