Hi Alan,
It is recommended to configure the corresponding DataTable column as
AutoIncrement, but set the initial value to -1 and increment also to -1.
Thus, the IDs of newly added rows will never conflict with the existing
ones. When the changes are propagated back to the database, you always know
that rows with negative IDs are new ones and call the appropriate stored
procedure which would create a new record instead of updating an existing
one.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Alan" <NO**************@yahoo.com.au> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
I have a form with text boxes bind with dataset of a table like Customer
with a CustomerID field.
I bind the dataset with binding manager and I want to add new record.
I called the AddNew() of the binding manager to add a new record, however,
I need to know the MemberID of the last record and add 1 to it and assigned
to the new record, how do I do that ?