2
Answers

sum values in datatable using linq based on conditions

Vignesh Kumar

Vignesh Kumar

9y
634
1
Hi,
I'm having a datatable like mentioned below.
ID Percentage
1        50
1        30
2        0
2       100
Result:
ID Percentage
1         80
2       100
 
Now I need to sum the percentage for each ID and the percentage for each ID should be 0 or 100 percentage.
If any one of the ID in table doesn't have 0 or 100 I need to alert. Pls suggest me how I can do this in linq and I think its the best way.
Answers (2)
1
Nanhe Siddique

Nanhe Siddique

NA 3.4k 110k 9y
hi deena 
i hope this link help you to write and read text 

http://www.aspdotnet-suresh.com/2010/12/how-to-read-and-write-text-file-using.html

0
Deena eliz

Deena eliz

NA 50 6.3k 9y
Thank you sir.. i used Append keyword for updating values in the same file.. 
Thanks a lots..