DataRowView.Item Property (Int32)

 

Gets or sets a value in a specified column.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

Public Property Item (
	ndx As Integer
) As Object

Parameters

ndx
Type: System.Int32

The specified column.

Property Value

Type: System.Object

The value of the column.

The following example displays the value in each item of each DataRowView in a DataView.


Private Shared Sub WriteViewRows(view As DataView)
   Dim colCount As Integer = view.Table.Columns.Count

   ' Iterate through the rows of the DataView.
   Dim rowView As DataRowView
   Dim i As Integer

   For Each rowView In view
     ' Display the value in each item of the DataRowView
     For i = 0 To colCount
        Console.Write(rowView(i) & vbTab)
     Next
     Console.WriteLine()
   Next
End Sub

.NET Framework
Available since 1.1
Return to top
Show: