DataView in ADO.NET



This article has been excerpted from book "A Programmer's Guide to ADO.NET in C#".

A DataView represents a view a DataSet object. You can set filters on the data or sort on data in the DataSet through different DataViews and produce different views of the data. For example, you can create a DataSet with three tables and create three different DataView objects for each table. Once you have a Data View object, you can attach it with any data-bound Control. Such as a DataGrid or a ComboBox control using data-bound control using data- bound control's DataSource property.

To create a DataView at design-time, drag the DataView from Toolbox > Data onto your form. Then create a DataSet object and set the DataView's table property to a table in the typed DataSet (see figure 4-55).

Figure-4.55.gif

Figure 4-55. Data View properties window

Conclusion

Hope this article would have helped you in understanding DataView in ADO.NET. See my other articles on the website on ADO.NET.


adobook.jpg
This essential guide to Microsoft's ADO.NET overviews C#, then leads you toward deeper understanding of ADO.NET.


Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.