LINQ Data Source Control(LDS)


The LINQ data source control follows the same thought stream as SDS and ODS but works with LINQ data contexts and entities rather than database or plain classes. Just like SDS and ODS you can hookup the LINQ data source control to any data bound controls such as GridView and DetailsView.


The LinqDataSource control provides an easy way to connect to data from a database or to an in-memory data collection such as an array. You can declaratively write all the conditions that are required for typical scenarios such as retrieving, filtering, ordering, and grouping the data. The control dynamically creates the LINQ queries from the values that you provide declaratively.


When you retrieve data from a LINQ to SQL data context class, you can also configure a LinqDataSource control to handle update, insert, and delete operations. The control does this without requiring you to write the SQL commands to perform these tasks.


To display the data in a Web page, you bind a data-bound control to the LinqDataSource control. Examples of data-bound controls are the GridView or DetailsView controls.


The following example shows the markup for a LinqDataSource control that connects to the Test database. It returns records from the Employee table that have a value in the id >20.










<asp:LinqDataSource
ContextTypeName="TestContext"
TableName="Employee"
Where="id>20"
ID="LinqDataSource1"
runat="server">
</asp:LinqDataSource>


 

                    

Aspnet Related Tutorials

...more

New Aspnet Resources

...more

Copyright © 2012 VisualBuilder. All rights reserved