Thread: LINQ: sorting by year

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    330

    LINQ: sorting by year

    I want to sort a list of price object by year but it just doesn't sort

    Code:
    var query = from p in prices orderby p.StartDate descending select p;
    Is it possible to sort with LINQ on a certain attribute? If so, how?

    NVM, something else went wrong. It works just fine
    Last edited by KIBO; 06-28-2012 at 01:47 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting of date,monthand year of 3 entity using structure
    By adroitsundar in forum C Programming
    Replies: 4
    Last Post: 09-25-2010, 11:10 PM
  2. LINQ, Verbose WHERE Clause
    By alphaoide in forum C# Programming
    Replies: 4
    Last Post: 08-04-2010, 09:04 AM
  3. LINQ: How to Read XML PARAMETER Attributes
    By SeekAndFind in forum C# Programming
    Replies: 2
    Last Post: 05-06-2010, 10:18 AM
  4. Program showing if a year its leap year or not.
    By Cyberman86 in forum C++ Programming
    Replies: 5
    Last Post: 09-12-2008, 08:00 AM
  5. SQL like outer join using LINQ
    By indigo0086 in forum C# Programming
    Replies: 2
    Last Post: 08-12-2008, 10:27 AM