المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DataGridView Calculations



C# Programming
05-07-2009, 11:32 AM
hi everybody

i m doing a small banking application

i have three tables master,transactions,ledgers

if i m entering the opening balance from master table it inserts in the ledger table and display that value properly.
if i update that value in master it updates ledger value properly.

i enter the values in grid view and save them

they are saved in ledger table as well as corresponding tables.here i m using storedprocedures for saving values.

ledger table is read only it displays only report in gridview

**transaction table have 3 columns
-------------------------------------------
date | deposit | withdrawl
-------------------------------------------

**my ledger table have 4 columns
-------------------------------------------
date | deposit | withdrawl | balance
-------------------------------------------

now the task is

if i enter amount in 'deposit'column of 'transaction table's gridview' ,it displays in deposit column of ledger gridview

for suppose
i enter amount in 'withdrawl 'column of 'transaction table's gridview' ,it displays in withdrawl column of ledger gridview


now balance will be calculated and displays in balance column of ledger's gridview


how can i calculate and displays in gridview of ledger


-------------------------------------------------------------------
date ------ deposit---- withdrawl-----balance
-------------------------------------------------------------------
1/1/2000----1500-----------0----------1500
2/2/2000------0----------1000----------500
3/3/2000-----700-----------0----------1200
4/4/2000------0-----------200---------1000
------------------------------------------------------------------


like this i need

hope u help me n this issue

with regards,
nagendra kumar