DataRow.Item Property (String, DataRowVersion)

Gets the specified version of data stored in the named column.

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

public Object this [
	string columnName,
	DataRowVersion version
] { get; }
/** @property */
public Object get_Item (String columnName, DataRowVersion version)

Not applicable.



The name of the column.


One of the DataRowVersion values that specifies the row version that you want. Possible values are Default, Original, Current, and Proposed.

Property Value

An Object that contains the data.

Exception typeCondition


The column specified by columnName cannot be found.


The data types of the value and the column do not match.


The row does not have this version of data.


The row was deleted.

The version should not be confused with the RowState property. The version argument describes the state of the data that is contained by the column relative to the column's original value. The RowState property describes the state of the whole row relative to its parent DataTable.

When you set the property, an exception is generated if an exception occurs in the ColumnChanging event.

If this is an immediate edit, see EndEdit for the exceptions that can be generated.

The following example gets the current version of data at a clicked cell of a DataGrid control.

private void DataGrid1_Click(object sender, System.EventArgs e)
    // Set the current row using the RowNumber 
    // property of the CurrentCell.
    DataRow currentRow =

    // Print the current value of the column named "FirstName."

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions