LINQ: sorting by year

This is a discussion on LINQ: sorting by year within the C# Programming forums, part of the General Programming Boards category; I want to sort a list of price object by year but it just doesn't sort Code: var query = ...

  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 02: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-26-2010, 12:10 AM
  2. LINQ, Verbose WHERE Clause
    By alphaoide in forum C# Programming
    Replies: 4
    Last Post: 08-04-2010, 10:04 AM
  3. LINQ: How to Read XML PARAMETER Attributes
    By SeekAndFind in forum C# Programming
    Replies: 2
    Last Post: 05-06-2010, 11: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, 09:00 AM
  5. SQL like outer join using LINQ
    By indigo0086 in forum C# Programming
    Replies: 2
    Last Post: 08-12-2008, 11:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21