This is a migrated thread and some comments may be shown as answers.

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

2 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zdeněk
Top achievements
Rank 1
Zdeněk asked on 23 Mar 2012, 08:36 PM
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 Answers, 1 is accepted

Sort by
0
Zdeněk
Top achievements
Rank 1
answered on 23 Mar 2012, 08:37 PM
... I'm sorry for strange big text. No clue why...
0
Damyan Bogoev
Telerik team
answered on 26 Mar 2012, 12:51 PM

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 >>
Tags
General Discussions
Asked by
Zdeněk
Top achievements
Rank 1
Answers by
Zdeněk
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or