DataTableExtensions::AsDataView<T> Method (EnumerableRowCollection<T>^)
Creates and returns a LINQ-enabled DataView object representing the LINQ to DataSet query.
Assembly: System.Data.DataSetExtensions (in System.Data.DataSetExtensions.dll)
public: generic<typename T> where T : DataRow [ExtensionAttribute] static DataView^ AsDataView( EnumerableRowCollection<T>^ source )
Parameters
- source
-
Type:
System.Data::EnumerableRowCollection<T>^
The source LINQ to DataSet query from which the LINQ-enabled DataView is created.
Type Parameters
- T
The type of objects in the source sequence, typically DataRow.
DataView enables data binding scenarios for LINQ to DataSet and can be created from a LINQ to DataSet query. The DataView represents the query itself, and is not a view on top of the query. The newly created DataView infers the filtering and sorting information from the query it is created from. The DataView is then bound to a UI control, such as a DataGrid or a DataGridView, providing a simple data-binding model.
The parameter T of the input parameter source can only be of type DataRow or a type derived from DataRow.
The following query operators, only, are supported in a query used to create DataView:
M:System.Data.EnumerableRowCollectionExtensions.Select``2(System.Data.EnumerableRowCollection{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})
For more information and examples, see Creating a DataView Object (LINQ to DataSet).
Available since 3.5