DataRowView.Item Property (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets a value in a specified column.

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

public object this[
	int ndx
] { get; set; }


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 static void WriteViewRows(DataView view)
    int colCount = view.Table.Columns.Count;

    // Iterate through the rows of the DataView.
    foreach (DataRowView rowView in view)
        // Display the value in each item of the DataRowView
        for (int i = 0; i < colCount; i++)
            Console.Write(rowView[i] + "\table");

.NET Framework
Available since 1.1
Return to top