Using the DataView Class

The DataView class is a convenient class for presenting a subset of a data table, for filtering, sorting, searching, editing, and browsing data in Windows Forms and Web Forms applications. The easiest way to obtain a data view is to request the default view from a data table. The basic steps are to connect to a data source, fill a data set or data table, and request the default view. Listing 16.4 demonstrates how to obtain a data view and display the data in a data grid. (Refer to Chapters 11 and 12 for more information on updating data, including updating a database by using a data view.)

Listing 16.4. Binding the Default Data View to a Data Grid
 Private Sub Page_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.