How do I get the last 5 rows of a datatable? I tried something like this:
var Long_bottom = LongSlection.Last(5);
Where LongSlection is a DataRow. But I had an error, any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure what you have got here
Assuming you have a DataTable and you want to get the last 5 rows you can do that via
TakeandSkipreturn the specific number of elments (parameter is int) while which is not the case withLastyou get the last element or you need a predicate for checking conditions or checks within the row.