I’ve updated my TableAdapter’s advanced options, so it would Refresh the data table.
I’m looking to retrieve the SCOPE_IDENTITY of the new added row, right after I use TableAdapter.Update.
How can this be achieved?
Thanks!
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.
The
TableAdapterwill insert theSCOPE_IDENTITYautomatically at the end of the insert statement. TheDataRowcontains the newly created identity value after the insert. Just don’t set the PK column before you add the row to the table and update it via theTableAdapter.