locked
Sort custom struct in LINQ 2 SQL (C#) RRS feed

  • Question

  • I wrote a custom struct in C#, but I cannot use in PRIMARY Key and cannot use in sort expressions.

    for example:

    var t =from z in table 1 orderby z.d1 select z;
    

    Got error. (d1 type is my custom DateTime struct and it's sql type is DateTime2)

    My struct has a direct cast from/to standard DateTime

    Please help, Thanks


    Sorry for my bad ENGLISH!!!
    Wednesday, May 25, 2011 1:55 AM