Export (0) Print
Expand All

DataRowView.Item Property (Int32)

Gets or sets a value in a specified column.

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

'Declaration
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft