471,325 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Re: LinqToSql Paging problem (bug?) with Skip and Take

You wrote a great deal and there is so much I would have liked to
elaborate on but this really de-railed the whole debate. You posted
that linq DOES throw an exception if its not ordered, and that runs
contrary to my experience.

On Apr 21, 1:26 am, "Frans Bouma [C# MVP]"
Back to the linq provider: using skip/take without orderby gives an
exception. This is to prevent that your application keeps on working
and produces WRONG results.
We wouldn't be having this conversation if it had thrown an error. It
doesn't. For as much as I'd like linq to provide its own default
consistent paging-semantics friendly row ordering when one isn't
specified, i don't mind having to provide my own. But I did NOT expect
linq to just start spitting random rows at me.

After finally determining the right place to look in the linq to sql
docuentation: it turns out in linq to sql, skip/take on an unordered
query is 'undefined', not 'throw an exception'.

Personally I still think it should throw an error rather than
returning something that's undefined, and that it would be useful for
linq to impose a default ordering that would be consistent between
page requests on its own (although I understand that would impose a
performance hit on certain types of query -- so maybe it should be an
option instead of automatic (e.g. page(int skiprows, int takerows,
bool AutoOrdering) but that's a question for the next version i guess.
At least the issue is documented if you look in the right place.

-best regards,
Jun 27 '08 #1
0 966

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

59 posts views Thread by AK | last post: by
8 posts views Thread by Matthew Curiale | last post: by
1 post views Thread by joerage | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
reply views Thread by Don Miller | last post: by
4 posts views Thread by Tyno Gendo | last post: by
1 post views Thread by Bram | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.