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
How is it possible to get 2 tables of data at a time by using data reader?
What is executequery?
Define table relations?
What are the types of databinding?
What is Data view?
Explain the overview of ado.net architecture?
Explain what are the steps to connect to a database?
What is executenonquery ado.net?
Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?
What is data relation?
Describe the command object and its method.
What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?
What are the different execute methods of Ado.Net?
Explain how to bind the controls(best practice) comboboxes to the data in the dataset?
What is fill method in ado.net?