How to: Use OpenAccessLinqDataSource in ASP.NET Application
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
This topic will walk you through the common task of using OpenAccessLinqDataSource with Telerik Data Access Domain Model in ASP.NET Applications.
It is assumed that the following initial steps are performed:
- First, a new ASP.NET Web Application is created.
- Second, a new Telerik Data Access Domain Model is added to the project. For more information, please refer to the Database First Scenario topic.
-
Build your project.
How to Add and Configure a New OpenAccessDataSource
To add and configure a new OpenAccessDataSource to your page:
- Open your page in design mode.
-
Drag a new OpenAccessLinqDataSource component from the Toolbox to the designer.
-
Right-click the OpenAccessLinqDataSource item in the designer and select Configure Data Source... from the context menu. This will run the OpenAccessLinqDataSource Configuration Wizard. In the first page of the wizard, you have to specify the OpenAccessContext that will be used and select the target entity. Click Next to continue.
-
The Configure Data Selection dialog is the second page of the OpenAccessLinqDataSource wizard. The second page of the wizard allows you to specify which properties will be selected (retrieved) from the database. Also, you could filter, sort and group the retrieved records.
Adding RadScriptManager
The next step is to add a RadScriptManager and register a HttpHandler. For more information how to complete this task, check out How to: Bind Data to ASP.NET Controls.
Reading and Displaying Data
The final step is to connect the OpenAccessLinqDataSource component to a data control. For example:
- Drag a new RadGrid control to your page.
-
By using the Smart Tag of the control, set the data source to the OpenAccessLinqDataSource.
Next Steps
For additional information, you could refer to the following sections: