Click here to Skip to main content
15,913,268 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all visitors
How can i sum multi datatables in dataset?
i have 1 dataset and in 1 dataset i have 4 datatables.
i want to sum each column of each datatable.
How can i do that?

Best Regards,
Posted
Comments
Sandeep Mewara 6-May-11 23:26pm    
It's simple looping through one table at a time and sum the rows. Tried it?

dataset1.datatable1.sum("sum(colum1)",string.empty)
dataset1.datatable2.sum("sum(colum1)",string.empty)
dataset1.datatable3.sum("sum(colum1)",string.empty)
dataset1.datatable4.sum("sum(colum1)",string.empty)
try something like this!
 
Share this answer
 
Comments
soeun tony 8-May-11 21:49pm    
Thanks for your reply.
if do like this. it means that we have 4 results(1 for datatable1 result,2 for datatable2 result,3 for datatable3 result,4 for datatable4 resutl). but i want to get only one result and that result will sum all columns of each datatable.
Best Regards,
sumary in text box:
dim d1 as ineger
dim d2 as integer 
dim d3 as inrteger
dim d4 as integer

d1=dataset1.datatable1.sum("sum(colum1)",string.empty) 
d2=dataset1.datatable2.sum("su(colum1)",string.empty)
d3=dataset1.datatable3.sum("sum(colum1)",string.empty)
d4=dataset1.datatable4.sum("sum(colum1)",string.empty)

me.textbox1.text=d1+d2+d3+d4
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900