I have two forms - Credit.aspx & Debit.aspx. Both use the same table. The former saves only credit records and the latter-debit.
TABLE:COLUMN DATATYPE
------------------
ID int
RefID int
Credit Decimal
Debit Decimal
ID is an AutoIdentity column.
Using C# to save data.
Only, When saving a credit record, I would like to save the ID as also its RefID. The Credit form can save single or many records at a time. If the data type was GUID, we would have known beforehand and is easy, but now is not the case.
The expected output would be
ID RefID Credit Debit
-------------------------
9 9 2.0 0.0
10 10 3.0 0.0
11 9 0.0 1.0
12 9 0.0 4.0
So, is it possible.
Getting the max(ID) doesnt seem like a good idea to me.