none
LINQDataSource control and Autopage RRS feed

  • Question

  • Does enabling the autopage property on the linqdatasource actually retrieve X (depending on page size) records from the database or does it initially pull down all records that match the query?
    Monday, October 17, 2011 4:56 PM

Answers

  • Hi Steven;

    To your question, " Does enabling the autopage property on the linqdatasource actually retrieve X (depending on page size) records from the database or does it initially pull down all records that match the query" as per Microsoft documentation at LinqDataSource.AutoPage Property

    Microsoft Documentation:

    When the AutoPage property is set to true, the LinqDataSource control retrieves only enough records for one page in the data-bound control. It uses the Skip<TSource> and Take<TSource> methods to retrieve the records for the current page.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Tuesday, October 18, 2011 3:20 PM
  • Hi Steven,

    @Fernandoo is right. I'd like give your sample about how to paging with LINQDataSource: http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx

    -----------------------------------

    We will also take advantage of the built-in paging/sorting support within LINQ to SQL to ensure that features like the product listing paging/sorting are performed not in the middle-tier, but rather in the database (meaning only 10 products are retrieved from the database at any given time - we are not retrieving thousands of rows and doing the sorting/paging within the web-server). 

    ---------------------------------

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 20, 2011 7:02 AM
    Moderator

All replies

  • Hi Steven;

    To your question, " Does enabling the autopage property on the linqdatasource actually retrieve X (depending on page size) records from the database or does it initially pull down all records that match the query" as per Microsoft documentation at LinqDataSource.AutoPage Property

    Microsoft Documentation:

    When the AutoPage property is set to true, the LinqDataSource control retrieves only enough records for one page in the data-bound control. It uses the Skip<TSource> and Take<TSource> methods to retrieve the records for the current page.

     


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Tuesday, October 18, 2011 3:20 PM
  • Hi Steven,

    @Fernandoo is right. I'd like give your sample about how to paging with LINQDataSource: http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx

    -----------------------------------

    We will also take advantage of the built-in paging/sorting support within LINQ to SQL to ensure that features like the product listing paging/sorting are performed not in the middle-tier, but rather in the database (meaning only 10 products are retrieved from the database at any given time - we are not retrieving thousands of rows and doing the sorting/paging within the web-server). 

    ---------------------------------

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 20, 2011 7:02 AM
    Moderator
  • Thank you both very much, sorry for the delayed response.. Red hot deadlines.
    Friday, November 11, 2011 12:18 AM