I want to retrieve identity column value after running Insert or Update (using Access DB in C#). How can I do it?
i use a Typed dataset to fill and update…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For retrieving the identity of inserted rows see this link:
http://msdn.microsoft.com/en-us/library/ks9f57t0%28VS.80%29.aspx
This link describes how to find the value of an inserted row in SQL, you then need to return that row in a SELECT statement (as Access does not support return parameters)
You may also be interested in this question, which compares the different methods of returning the identity.
Best way to get identity of inserted row?