Working with huge datasources (LINQ)

jqGrid for ASP.NET is able to handle millions of rows of data. This includes paging, sorting and searching all rows in the datasource. The key here is to use "clever" datasources, which handle these types of operations intelligently. ASP.NET provides the LinqDataSource control, which is able to do just that. No matter how large your datasource is, LinqDataSource crafts SQL queries to the database in such a way that only the data required is fetched from server to client.

This is just one benefit of using LinqDataSource - the other benefit is that jqGrid provides the functionality to sort, page and search data in LINQ without a single line of code.

Note: additional third party products like NHibernate, LLBLGen, SubSonic, etc also have intelligent paging, sorting and filtering and jqGrid will support that. In technical terms, any datasource implementing CanPage and CanSort and genereting effective SQL will work with jqGrid in a purely codeless way

Here is one possible setup:

<trirand:JQGrid runat="server" ID="JQGrid2" DataSourceID="LinqDataSource1" Width="680px"> <Columns> <trirand:JQGridColumn DataField="OrderID" Sortable="false" Width="50" Searchable="false" /> <trirand:JQGridColumn DataField="OrderDate" DataFormatString="{0:d}" Width="100" Searchable="false" /> <trirand:JQGridColumn DataField="CustomerID" Width="100" Searchable="true" SearchControlID="CustomerIDDdl" SearchType="DropDown" SearchToolBarOperation="IsEqualTo" SearchDataType="String" /> <trirand:JQGridColumn DataField="Freight" Width="75" Searchable="true" SearchToolBarOperation="IsGreaterOrEqualTo" SearchValues="[All]:[All];10:> 10;20:> 20;50:> 50;100:> 100" SearchType="DropDown" SearchDataType="NonString"/> <trirand:JQGridColumn DataField="ShipName" Searchable="true" SearchToolBarOperation="Contains" SearchDataType="String" /> </Columns> <PagerSettings PageSize="100" PageSizeOptions="[100,200,500]" /> <ToolBarSettings ShowSearchToolBar="true" /> </trirand:JQGrid> <asp:LinqDataSource ID="LinqDataSource1" runat="server" AutoPage="true" AutoSort="true" ContextTypeName="GridTest.dbml.NorthWindDataClassesDataContext" Select="new (OrderID, CustomerID, OrderDate, Freight, ShipName)" TableName="OrdersLarges"> </asp:LinqDataSource>


  Last Updated: 11/11/2009 | © Trirand, 2009