Reputation: 33
Trying to get the Autoincrement ID of a row after TableAdapter.Update. The data is Binded so there's no row being added to the datatable as in this case.
Any ideas on how to solve this?
Thank you
Upvotes: 0
Views: 1588
Reputation: 386
Why not use this after TableAdapter.Update
:
CType(xBindingSource.Current, DataRowView).Item("ID")
Upvotes: 1
Reputation: 1641
You need to retrieve the newly created id by including a select statement in your insert query; you need to change the executemode to Scalar, too. This blog post has more detail
Upvotes: 0