Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is Data view?

1152


What are the parameters that control most of connection pooling behaviors?

1053


What are the features of ado.net?

1121


What is difference between sqldatareader and sqldataadapter?

979


What is shadow copy?

1026


How to perform sorting on a table in ADO.NET?

1080


How do you update a dataset in ado.net and how do you update database through dataset?

973


List all the steps in order, to access a database through ado.net?

1128


What is bubbled event can you please explain?

1108


What we do with the object of ado.net dataset after using it?

1123


What is the difference in an abstract class and an interface?

1071


Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.

1189


How to check if a datareader is closed or opened? IsClosed()

1071


Which is faster ado.net or linq?

1068


How would you connect to a database by using .NET?

994