DataRowCollection Class
Represents a collection of rows for a DataTable.
Assembly: System.Data (in System.Data.dll)
The DataRowCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | Count | Gets the total number of DataRow objects in this collection. (Overrides InternalDataCollectionBase::Count.) |
![]() ![]() | IsReadOnly | Gets a value that indicates whether the InternalDataCollectionBase is read-only. (Inherited from InternalDataCollectionBase.) |
![]() ![]() | IsSynchronized | Gets a value that indicates whether the InternalDataCollectionBase is synchonized. (Inherited from InternalDataCollectionBase.) |
![]() ![]() | Item | Gets the row at the specified index. |
![]() ![]() | List | Gets the items of the collection as a list. (Inherited from InternalDataCollectionBase.) |
![]() ![]() | SyncRoot | Gets an object that can be used to synchronize the collection. (Inherited from InternalDataCollectionBase.) |
| Name | Description | |
|---|---|---|
![]() ![]() | Add(DataRow) | Adds the specified DataRow to the DataRowCollection object. |
![]() ![]() | Add(array<Object>) | Creates a row using specified values and adds it to the DataRowCollection. |
![]() ![]() | Clear | Clears the collection of all rows. |
![]() ![]() | Contains(Object) | Gets a value that indicates whether the primary key of any row in the collection contains the specified value. |
![]() ![]() | Contains(array<Object>) | Gets a value that indicates whether the primary key columns of any row in the collection contain the values specified in the object array. |
![]() ![]() | CopyTo(Array, Int32) | Copies all the DataRow objects from the collection into the given array, starting at the given destination array index. (Overrides InternalDataCollectionBase::CopyTo(Array, Int32).) |
![]() ![]() | CopyTo(array<DataRow>, Int32) | Copies all the DataRow objects from the collection into the given array, starting at the given destination array index. |
![]() ![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | Find(Object) | Gets the row specified by the primary key value. |
![]() ![]() | Find(array<Object>) | Gets the row that contains the specified primary key values. |
![]() ![]() | GetEnumerator | Gets an IEnumerator for this collection. (Overrides InternalDataCollectionBase::GetEnumerator().) |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | IndexOf | Gets the index of the specified DataRow object. |
![]() ![]() | InsertAt | Inserts a new row into the collection at the specified location. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | Remove | Removes the specified DataRow from the collection. |
![]() ![]() | RemoveAt | Removes the row at the specified index from the collection. |
![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The DataRowCollection is a major component of the DataTable. While the DataColumnCollection defines the schema of the table, the DataRowCollection contains the actual data for the table, where each DataRow in the DataRowCollection represents a single row.
You can call the Add and Remove methods to insert and delete DataRow objects from the DataRowCollection. You can also call the Find method to search for DataRow objects that contain specific values in primary key columns, and the Contains method to search character-based data for single words or phrases.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
