I have a datatable like this.
User Unit Score
kiran testing 2
kiran demo 1
kiran TRacking 3.5
manu 1234 .5
manu 1567 3.5
Priya 1689 9
Tom 1567 2
Tom 3454 5
Peter testing 2
Peter demo 2.5
Now I need result like this in another datatable:
User Svc VSS
kiran 6.5
manu 4.0
Priya 9.0
Tom 7.0
Peter 4.5
I need to check for user their unit, based on that I need to sum up the Score. If the unit contains string then those score value should go to a new datatable column called svc.
If the unit contains Integer then those score value should go to a new column called vss
So that the final result will be like this:
User Svc VSS
kiran 6.5
manu 4.0
Priya 9.0
Tom 7.0
Peter 4.5
I am new to C#.
Here is a solution, although keep in mind DataTables are awkward to work with and it’s better to create a collection of objects to work with instead.