addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

RE: [dotnet-120] LINQ2SQL and sorting in ListView

From: Alec B.
Sent on: Monday, November 5, 2007 1:42 PM
 
SQL2005 has a ROW_NUMBER() (http://msdn2.microsoft.com/en-us/library/ms186734.aspx) feature which allows you to perform paging on the SQL server side and return just the right set of rows. ASP.NET 2.0 SqlDataSource already utilizes it for paging through data, e.g. with GridView control.
 
Not sure if LINQ2SQL and WPF databinding utilizes it though.
 
-Alec.
 
 

From: [address removed] [[address removed]] On Behalf Of Erb Cooper [[address removed]]
Sent: Monday, November 05,[masked]:22 PM
To: [address removed]
Subject: RE: [dotnet-120] LINQ2SQL and sorting in ListView

Not sure how the 2 are related.  You need to sort the entire collection before you know which the first 100 are.

 

From: [address removed] [mailto:[address removed]] On Behalf Of Alec Bryte
Sent: Monday, November 05,[masked]:37 PM
To: [address removed]
Subject: [dotnet-120] LINQ2SQL and sorting in ListView

 

Hey Guys,

 

Has anyone attempted to use sorting when binding a result set from a LINQ select query to a ListView.

I found several examples on the web but they all use an offline collection of items.

 

Right now when a user clicks a column header for sorting, I'm redoing the query with a different "orderby" clause in it and rebinding it to the ListView, but something is telling me there is an easier way to do it. I wonder if there is a built-in support for optimized SQL data retrieval and pagination/virtualization, e.g. if I have[masked] records, the ListView should retrieve only the first 100 or something, until a user scrolls down to see the next 100 batch.

 

Thanks,

-Alec.





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Alec Bryte ([address removed]) from New York .NET Meetup Group.
To learn more about Alec Bryte, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup.com Customer Service: [address removed]
632 Broadway New York NY 10012 USA





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Erb Cooper ([address removed]) from New York .NET Meetup Group.
To learn more about Erb Cooper, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup.com Customer Service: [address removed]
632 Broadway New York NY 10012 USA

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy