Last post Jun 29, 2018 10:31 AM by Mukesh_Kumar
Jun 29, 2018 10:18 AM|JagjitSingh|LINK
I have one field Id which is AutoGenerated. Is it possible when record is Inserted i am able to get Id Value
Jun 29, 2018 10:31 AM|Rajneesh Verma|LINK
Use ExecuteScaler - Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Jun 29, 2018 10:33 AM|Mukesh_Kumar|LINK
Identity Field Value
Here you haven't mentioned about in which technology you want to get Id value. Just for assumption, you have this question under Web Forms. I believe, you are using .Net.
In Ado.Net, you can get last inserted value as following way.
Int32 newId = (Int32) myCommand.ExecuteScalar();
For more info, review this
Jun 29, 2018 10:35 AM|Mukesh_Kumar|LINK
You can also visit previously ask question n asp.net forums as follows.