asp.net.ph

DataTable Class

System.Data Namespace


Represents one table of in-memory data.

DataTable Class Members

Collapse   Constructors

Visibility Constructor Parameters
public DataTable ( )
public DataTable ( String tableName )
public DataTable ( String tableName , String tableNamespace )

Collapse   Properties

Visibility Name Value Type Accessibility
public CaseSensitive Boolean [ Get , Set ]
public ChildRelations DataRelationCollection [ Get ]
public Columns DataColumnCollection [ Get ]
public Constraints ConstraintCollection [ Get ]
public DataSet DataSet [ Get ]
public DefaultView DataView [ Get ]
public DisplayExpression String [ Get , Set ]
public ExtendedProperties PropertyCollection [ Get ]
public HasErrors Boolean [ Get ]
public IsInitialized Boolean [ Get ]
public Locale CultureInfo [ Get , Set ]
public MinimumCapacity Int32 [ Get , Set ]
public Namespace String [ Get , Set ]
public ParentRelations DataRelationCollection [ Get ]
public Prefix String [ Get , Set ]
public PrimaryKey DataColumn [ Get , Set ]
public RemotingFormat SerializationFormat [ Get , Set ]
public Rows DataRowCollection [ Get ]
public Site ISite [ Get , Set ]
public TableName String [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
public AcceptChanges ( ) Void
public BeginInit ( ) Void
public BeginLoadData ( ) Void
public Clear ( ) Void
public Clone ( ) DataTable
public Compute ( String expression , String filter ) Object
public Copy ( ) DataTable
public CreateDataReader ( ) DataTableReader
protected CreateInstance ( ) DataTable
public EndInit ( ) Void
public EndLoadData ( ) Void
public GetChanges ( ) DataTable
public GetChanges ( DataRowState rowStates ) DataTable
public static GetDataTableSchema ( XmlSchemaSet schemaSet ) XmlSchemaComplexType
public GetErrors ( ) DataRow
public GetObjectData ( SerializationInfo info , StreamingContext context ) Void
protected GetRowType ( ) Type
protected GetSchema ( ) XmlSchema
public ImportRow ( DataRow row ) Void
public Load ( IDataReader reader , LoadOption loadOption ) Void
public Load ( IDataReader reader , LoadOption loadOption , FillErrorEventHandler errorHandler ) Void
public Load ( IDataReader reader ) Void
public LoadDataRow ( Object values , LoadOption loadOption ) DataRow
public LoadDataRow ( Object values , Boolean fAcceptChanges ) DataRow
public Merge ( DataTable table , Boolean preserveChanges , MissingSchemaAction missingSchemaAction ) Void
public Merge ( DataTable table , Boolean preserveChanges ) Void
public Merge ( DataTable table ) Void
public NewRow ( ) DataRow
protected NewRowFromBuilder ( DataRowBuilder builder ) DataRow
protected OnPropertyChanging ( PropertyChangedEventArgs pcevent ) Void
protected OnRemoveColumn ( DataColumn column ) Void
protected OnRowChanged ( DataRowChangeEventArgs e ) Void
protected OnRowChanging ( DataRowChangeEventArgs e ) Void
protected OnRowDeleted ( DataRowChangeEventArgs e ) Void
protected OnRowDeleting ( DataRowChangeEventArgs e ) Void
protected OnTableCleared ( DataTableClearEventArgs e ) Void
protected OnTableClearing ( DataTableClearEventArgs e ) Void
protected OnTableNewRow ( DataTableNewRowEventArgs e ) Void
public ReadXml ( Stream stream ) XmlReadMode
public ReadXml ( XmlReader reader ) XmlReadMode
public ReadXml ( String fileName ) XmlReadMode
public ReadXml ( TextReader reader ) XmlReadMode
public ReadXmlSchema ( Stream stream ) Void
public ReadXmlSchema ( XmlReader reader ) Void
public ReadXmlSchema ( String fileName ) Void
public ReadXmlSchema ( TextReader reader ) Void
protected ReadXmlSerializable ( XmlReader reader ) Void
public RejectChanges ( ) Void
public Reset ( ) Void
public Select ( ) DataRow
public Select ( String filterExpression , String sort , DataViewRowState recordStates ) DataRow
public Select ( String filterExpression , String sort ) DataRow
public Select ( String filterExpression ) DataRow
public ToString ( ) String
public WriteXml ( XmlWriter writer ) Void
public WriteXml ( XmlWriter writer , Boolean writeHierarchy ) Void
public WriteXml ( Stream stream , XmlWriteMode mode , Boolean writeHierarchy ) Void
public WriteXml ( TextWriter writer , Boolean writeHierarchy ) Void
public WriteXml ( Stream stream ) Void
public WriteXml ( Stream stream , Boolean writeHierarchy ) Void
public WriteXml ( TextWriter writer ) Void
public WriteXml ( TextWriter writer , XmlWriteMode mode , Boolean writeHierarchy ) Void
public WriteXml ( TextWriter writer , XmlWriteMode mode ) Void
public WriteXml ( String fileName , XmlWriteMode mode , Boolean writeHierarchy ) Void
public WriteXml ( XmlWriter writer , XmlWriteMode mode , Boolean writeHierarchy ) Void
public WriteXml ( XmlWriter writer , XmlWriteMode mode ) Void
public WriteXml ( String fileName , Boolean writeHierarchy ) Void
public WriteXml ( String fileName , XmlWriteMode mode ) Void
public WriteXml ( String fileName ) Void
public WriteXml ( Stream stream , XmlWriteMode mode ) Void
public WriteXmlSchema ( XmlWriter writer ) Void
public WriteXmlSchema ( XmlWriter writer , Boolean writeHierarchy ) Void
public WriteXmlSchema ( Stream stream , Boolean writeHierarchy ) Void
public WriteXmlSchema ( TextWriter writer , Boolean writeHierarchy ) Void
public WriteXmlSchema ( String fileName ) Void
public WriteXmlSchema ( TextWriter writer ) Void
public WriteXmlSchema ( Stream stream ) Void
public WriteXmlSchema ( String fileName , Boolean writeHierarchy ) Void

Remarks

The DataTable is a central object in the ADO.NET library. Other objects that use the DataTable include the DataSet and the DataView.

When accessing DataTable objects, note that they are conditionally case-sensitive. For example, if one DataTable is named "myTable" and another is named "MyTable", a string used to search for one of the tables is regarded as case-sensitive. However, if "myTable" exists and "MyTable" does not, the search string is regarded as case-insensitive. For more information about working with DataTable objects, see Creating a DataTable.

If you are creating a DataTable programmatically, you must first define its schema by adding DataColumn objects to the DataColumnCollection ( accessed through the Columns property ). For more information about adding DataColumn objects, see Adding DataColumns to a Table.

To add rows to a DataTable, you must first use the NewRow method to return a new DataRow object. The NewRow method returns a row with the schema of the DataTable, as it is defined by the table' s DataColumnCollection. The maximum number of rows that a DataTable can store is 16,777,216. For more information, see Adding Data to a Table.

The schema of a table is defined by the DataColumnCollection, the collection of DataColumn objects. The DataColumnCollection is accessed through the Columns property. See DataColumn and DataColumnCollection for more information about defining a schema for the table.

The DataTable contains a collection of Constraint objects that can be used to ensure the integrity of the data. For more information, see Adding Constraints to a Table.

To determine when changes are made to a table, use one of the following events: RowChanged, RowChanging, RowDeleting, and RowDeleted. For more information, see Working with DataTable Events.

When an instance of DataTable is created, some of the read/write properties are set to initial values. For a list of these values, see the DataTable constructor.

NOTE: the DataSet and DataTable objects inherit from MarshalByValueComponent, and support the ISerializable interface for remoting. These are the only ADO.NET objects that can be remoted.

See Also

DataColumnCollection   DataColumn   DataRow   DataSet   DataView   DataRowCollection Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph