O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with DataView Objects in Code

The DataView class offers functionality similar to that of the DataTable class’s Select method. Let’s take a closer look at this functionality and compare it to the Select method as we go.

Creating DataView Objects

To use a DataView object to view data in a DataTable, you must associate it with a DataTable object. You can specify the DataTable that the DataView will use in one of two ways: by setting the DataView object’s Table property or by using the DataView’s constructor. The following code snippets are equivalent:

Visual Basic

Dim tbl As New DataTable("TableName") Dim vue As DataView 'Create the DataView and associate it with the DataTable vue = New DataView() vue.Table = tbl 'Perform both operations through ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required