Retrieve Identity value from inserted row in Access Database using TableAdapter
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=58862
I would like to retrieve the value of an inserted identity column from an Access database immediately after a new row is inserted using C#.
The example in the post above uses VB andI am confused about where to put the following statement:
m_adapter.RowUpdated +=newOleDbRowUpdatedEventHandler(m_adapter_RowUpdated); |
m_adapter refers to the TableAdapters OleDbDataAdapter in the designer.cs file. The only places I can think to put it are the TableAdapter constructor and the TableAdapter InitAdapter() method. Both of these reside in the designer.cs file and would be overwritten if I changed the DataSet.How can I hook into the RowUpdated event using C# in a partial class outside of the mydataset.designer.cs file?
I may of course be missing the point! Many thanks for your help.

