Class Row
Represents a row in a data table.
public sealed class Row
- Inheritance
-
Row
- Inherited Members
Constructors
Row(object[])
Initializes a new instance of the Row class.
public Row(object[] values)
Parameters
valuesobject[]The object values of the row to create. The values will be converted using
.Convert.ToString(value, CultureInfo.InvariantCulture)
Remarks
This constructor overload sets Owner to null.
Exceptions
- ArgumentNullException
If
valuesisnull.
Row(object[], RowCollection)
Initializes a new instance of the Row class.
public Row(object[] values, RowCollection owner)
Parameters
valuesobject[]The object values of the row to create. The values will be converted using
.Convert.ToString(value, CultureInfo.InvariantCulture)ownerRowCollectionThe RowCollection this row belongs to or
nullif the row is not yet bound to a collection.
Exceptions
- ArgumentNullException
If
valuesisnull.
Row(string[])
Initializes a new instance of the Row class.
public Row(string[] values)
Parameters
Remarks
This constructor overload sets Owner to null.
Exceptions
- ArgumentNullException
If
valuesisnull.
Row(string[], RowCollection)
Initializes a new instance of the Row class.
public Row(string[] values, RowCollection owner)
Parameters
valuesstring[]The string values of the row to create.
ownerRowCollectionThe RowCollection this row belongs to or
nullif the row is not yet bound to a collection.
Exceptions
- ArgumentNullException
If
valuesisnull.
Properties
this[int]
Gets or sets the string value at the specified index.
public string this[int index] { get; set; }
Parameters
indexint
Property Value
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the collection.
this[string]
Gets or sets the string value with the specified column name.
public string this[string columnName] { get; set; }
Parameters
columnNamestring
Property Value
Exceptions
- ArgumentException
If the row is not bound to a row collection or the Owner row collection is not bound to a column collection.
- KeyNotFoundException
If the associated data table does not contain a column with the specified name.
Owner
Gets or sets the RowCollection this row belongs to.
public RowCollection Owner { get; set; }
Property Value
- RowCollection
The RowCollection this row belongs to or
nullif the row does not belong to a collection.
Values
Gets the values of this row.
public string[] Values { get; }
Property Value
- string[]
The values contained in this row.
Methods
ToDictionary()
Creates a dictionary that maps the column names of the associated data table to the values of this row.
public IDictionary<string, string> ToDictionary()
Returns
- IDictionary<string, string>
A dictionary mapping columns names to the values of this row.