| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | ms.assetid | caps.latest.revision | author | ms.author | manager | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data Binding and LINQ to DataSet |
03/30/2017 |
.net-framework |
|
article |
310bff4a-32dd-4f20-a271-6dbd82912631 |
2 |
JennieHubbard |
jhubbard |
jhubbard |
Data Binding and LINQ to DataSet
Data binding is the process that establishes a connection between the application UI and business logic. If the binding has the correct settings and the data provides the proper notifications, when the data changes its value, the elements that are bound to the data reflect changes automatically. The xref:System.Data.DataSet is an in- memory representation of data that provides a consistent relational programming model, regardless of the source of the data it contains. The ADO.NET 2.0 xref:System.Data.DataView enables you to sort and filter the data stored in a xref:System.Data.DataTable. This functionality is often used in data-binding applications. By using a xref:System.Data.DataView, you can expose the data in a table with different sort orders, and you can filter the data by row state or based on a filter expression. For more information about the xref:System.Data.DataView object, see DataViews.
[!INCLUDElinq_dataset] allows developers to create complex, powerful queries over a xref:System.Data.DataSet by using [!INCLUDEvbteclinqext]. However, a [!INCLUDElinq_dataset] query returns an enumeration of xref:System.Data.DataRow objects, which is not easily used in a binding scenario. To make binding easier, you can create a xref:System.Data.DataView from a [!INCLUDElinq_dataset] query. This xref:System.Data.DataView uses the filtering and sorting specified in the query, but is better suited for data binding. [!INCLUDElinq_dataset] extends the functionality of the xref:System.Data.DataView by providing [!INCLUDEvbteclinq] expression-based filtering and sorting, which allows for much more complex and powerful filtering and sorting operations than string-based filtering and sorting.
Note that the xref:System.Data.DataView represents the query itself and is not a view on top of the query. The xref:System.Data.DataView is bound to a UI control, such as a xref:System.Windows.Forms.DataGrid or a xref:System.Windows.Forms.DataGridView, providing a simple data binding model. A xref:System.Data.DataView can also be created from a xref:System.Data.DataTable, providing a default view of that table.
In This Section
Creating a DataView Object
Provides information about creating a xref:System.Data.DataView.
Filtering with DataView
Describes how to filter with the xref:System.Data.DataView.
Sorting with DataView
Describes how to sort with the xref:System.Data.DataView.
Querying the DataRowView Collection in a DataView
Provides information about querying the xref:System.Data.DataRowView collection exposed by xref:System.Data.DataView.
DataView Performance
Provides information about xref:System.Data.DataView and performance.
How to: Bind a DataView Object to a Windows Forms DataGridView Control
Describes how to bind a xref:System.Data.DataView object to a xref:System.Windows.Forms.DataGridView.