Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have the following codes which is DTO. Inside I have 3 rows of records. Row 1 and Row 2 have the same value in all column except for a column which is the time. How can I get the row from Row 2 onward until the last row? Below are my codes:

MeasurementDetailDtoList measurementDetailDtoList = new MeasurementDetailDtoList();
measurementDetailDtoList = GetUnitHistoryMeasurementDetailData();
Posted

1 solution

using Linq you can filter the list.
Does your MeasurementDetailDtoList is a single object or a list of Objects?

If you want to filter from the List then you can do like :

C#
List<measurementdetaildtolist> measurementDetailDtoList = new List<measurementdetaildtolist>();

measurementDetailDtoList.Where(a=>a.your selection criteria).ToList();

</measurementdetaildtolist></measurementdetaildtolist>
 
Share this answer
 
Comments
Jamie888 28-Jan-15 6:28am    
if I have a column which is EventId, then should I write like:
measurementDetailDtoList.Where(a=>a.EventId).ToList(); ?

FYI, I have passed a value which is EventId, then how should I code it?
Atish K. Singh 28-Jan-15 6:33am    
measurementDetailDtoList.Where(a=>a.EventId==EventId).ToList();
Jamie888 28-Jan-15 21:16pm    
Thank you. It has given me some hints on how to do it. I will update the solution once I have done it.
Atish K. Singh 29-Jan-15 5:12am    
Please mark answer as the solution if it has helped you

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