When I perform an insert with TableAdapter
:
int pid = this.purchaseTableAdapter.Insert(supplierid, datetime, "",
totalprice, amountpaid);
It returns the incorrect id 1
while it should return 15.
How to get the correct ID?
set the execute mode property to Scalar, then you get the ID, otherwise the rows-affected. You set the property properties window of the query not in the Query wizard.
(fig 28)