How to fetch the last inserted record in a particular table?
Answer Posted / raji22559
CommanObject.CommandText="Select @@Identity";
** Note: Over a given connection if any insert statement is
executed on a table with identity column , the back end
sql-server for the connection initializes a parameter by
name "@@Identity" with the value of Identity column for the
last inserted record.
| Is This Answer Correct ? | 18 Yes | 8 No |
Post New Answer View All Answers
What is Data view?
What are the parameters that control most of connection pooling behaviors?
What are the features of ado.net?
What is difference between sqldatareader and sqldataadapter?
What is shadow copy?
How to perform sorting on a table in ADO.NET?
How do you update a dataset in ado.net and how do you update database through dataset?
List all the steps in order, to access a database through ado.net?
What is bubbled event can you please explain?
What we do with the object of ado.net dataset after using it?
What is the difference in an abstract class and an interface?
Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.
How to check if a datareader is closed or opened? IsClosed()
Which is faster ado.net or linq?
How would you connect to a database by using .NET?