I have created web application which will add the values into database As customer id, available balance, due Amount and have to calculate the due amount against available Amount from client using vb .net.

For Ex. - I have three Bills in the Database as,

customer id | Due Amount

APP1 | 5|

APP1 | 5|

APP2 | 10|

Now from client APP1 , i have received 7 Total, so i have to clear the due amount according to Total Amount Received. That means, i have to update the due Amount, So APP1 will clear, have to update due amount to 3, For APP2, 10 deduct so due amount will be zero .

So Please help me to write this logic in vb .net.