How to get data from SQL DB via OA to RadGrid with max performance

3 posts, 0 answers
  1. Zdenek Plachy
    Zdenek Plachy avatar
    29 posts
    Member since:
    May 2007

    Posted 23 Mar 2012 Link to this post

    Hi,
    I'm solving pretty common scenario. I have say 500 records in some database table. I want to show them as quickly as possible into RagGrid with some paging, sorting and filtering. As far as I know there ase many ways. Which one is "best pratice" and most performance capable?

    1. Standard OpenAccessLinqDatasource with dynamic "where" in code
      <telerik:OpenAccessLinqDataSource runat="server" ID="ldsCustomers" ContextTypeName="MyDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" ResourceSetName="Customers" />

    2. Using NeedDataSource event of RadGrid
      Dim dc As New DataContext 'it is declared in masterpage in real application
      Dim myRecords=from q in dc.Customers OrderBy q.Name Select q
      rgCustomers.DataSource=myRecords

    3. Using OpenAccessLinqDataSource, but replace results
      Dim dc As New DataContext 'it is declared in masterpage in real application
      Dim myRecords=from q in dc.Customers OrderBy q.Name Select q
      e.Result=myRecords

    Are there some performance guidelines for OpenAccess in ASP.NET applications?

  2. Zdenek Plachy
    Zdenek Plachy avatar
    29 posts
    Member since:
    May 2007

    Posted 23 Mar 2012 Link to this post

    ... I'm sorry for strange big text. No clue why...
  3. DevCraft banner
  4. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 26 Mar 2012 Link to this post

    Hello Zdenek,

    You could use the first approach “Standard OpenAccessLinqDataSource with dynamic ‘where’ in code”. In this case the OpenAccessLinqDataSource paging, sorting and filtering will be executed on the server, when the data source is used from RadGrid for instance, the corresponding paging, sorting or filtering clauses will be handled internally, without implementing additional logic.

    For case 2 and 3 – you should handle the paging manually, by implementing additional handling for it.

    Additional helpful information can be found here and here. You could find the OpenAccessLinqDataSource example, shipped with the Product SDK, useful.

    Hope that helps. If any other questions arise, do not hesitate to contact us back.

    Greetings,
    Damyan Bogoev
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Back to Top