Datatable Fillter and Last row Value pick


#1

Hi,

Firstly, I did the connection from excel and build the datatable now I want to pick the last value as per filter criteria.
for e,g, say I have a table as below:
ColumnA Column B Columnc
A 6 2
A 2 3
B 5 2
A 3 1
C 2 9

As per above example, I have to filter as per columnA(lets say we are filtering A here) and need to take the value from columnB(which is 6 here) and from columnC we need to pick last value for ‘A’(which is 1 here)
filtered data below:
ColumnA Column B Columnc
A 6 2
A 2 3
A 3 1


#2

something like this?

dt.Select("[ColumnA]='A'").Last()(2).ToString


#3

Thanks… Working fine