Order column in a datatable
- by superartsy
I have two tables - Parent table (Clients- ClntID,ClntName) And Child Table ( Orders- ClntID,OrderNumber,OrderDate) - Order Number column has a value equal to how many orders the Client has. It is not an autonumber
ClntID ClntName
1 Company A
2 Company B
ClntID OrderNumber OrderDate
1 1 11/1/2009
1 2 11/15/2009
2 1 2/12/2008
2 1 7/13/2009
If I have a dataset for these tables, how do I insert the data in the Orders table and increment the OrderNumber value correctly.