O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

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

DataRow

The DataRow object represents a record in the DataTable. Its Item method provides access to its field values.

You have already seen some of the more useful DataRow properties and methods in the previous sections. The following sections review some of those methods and refer to the earlier sections for examples.

Item

The Item method gives access to the row’s field values. The most common ways to find a value in the Item collection are by field name and by number. For example, the following code sets the value of a DataRow’s LastName field and then displays the value of its first field:

data_row.Item("LastName") = "Stephens" 
MsgBox(data_row.Item(0)) 

The Item method can also take a DataColumn object as an index. Because the DataColumn’s ...

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