Working with DataView in C#
Loading
Working with DataView in C#
The DataView object
provides a window into a data table that can be sorted and filtered. A data
table can have many DataView objects
assigned to it, so the data can be viewed in many ways without requiring it to
be reread from the database. A major function of the DataView is to allow
data binding on both Windows Forms and Web Forms.
We can perform several operations with DataView:
Ex :
DataView dView = new DataView();
dView.Sort = "CreatedDate DESC"
Ex: dView.Table = DataSet1.Tables["Suppliers"]; dView.RowFilter = "City = 'New Delhi'";
Ex:
dView.RowStateFilter = DataViewRowState.ModifiedCurrent;
We can create a DataView using three ways:
Join the conversation! Your thoughts help the community grow.