Name

DataRowCollection

Synopsis

This collection contains DataRow objects. It’s accessed through the DataTable.Rows property and contains the data for a table. You can use the Find( ) method and Contains( ) method to locate records. Both methods accept a column value and search for it in the primary key field. If a matching row is found, the Contains( ) method returns true, and the Find( ) method returns the DataRow object.

public class DataRowCollection : InternalDataCollectionBase {

// Public Instance Properties

   public DataRow this[int 

                  index

                  ]{get; } 

// Protected Instance Properties

   protected override ArrayList List{get; }           // overrides InternalDataCollectionBase

                  // Public Instance Methods

   public virtual DataRow Add(object[ ] values);  

   public void Add(DataRow row);  

   public void Clear( );  

   public bool Contains(object key);  

   public bool Contains(object[ ] keys);  

   public DataRow Find(object key);  

   public DataRow Find(object[ ] keys);  

   public void InsertAt(DataRow row, int pos);  

   public void Remove(DataRow row);  

   public void RemoveAt(int index);  

}

Hierarchy

System.Object InternalDataCollectionBase(System.Collections.ICollection, System.Collections.IEnumerable) DataRowCollection

Returned By

DataTable.Rows

Get ADO.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.