|
-
March 13th, 2012, 01:02 PM
#1
Trying to find date of 2010 for all records in a list (version 4.0)
I'm going thru a list and trying to find only the records that have 2010 as their year and displaying the the record using this code:
var dateSorted =
from e in deserializedRoster
where DateTime.Equals = "2010"
select e;
foreach (var e in dateSorted) Console.WriteLine("Date 2010: {0}", e.ToString());
Console.WriteLine();
The line DateTime.Equals needs work. I don't know how to instruct the code to look only for 2010 in the year. The field is called "date".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|