Export (0) Print
Expand All

DataTable Methods

The DataTable type exposes the following members.

  NameDescription
Public method AcceptChanges Commits all the changes made to this table since the last time AcceptChanges was called.
Public method BeginInit Begins the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at run time.
Public method BeginLoadData Turns off notifications, index maintenance, and constraints while loading data.
Public method Clear Clears the DataTable of all data.
Public method Clone Clones the structure of the DataTable, including all DataTable schemas and constraints.
Public method Compute Computes the given expression on the current rows that pass the filter criteria.
Public method Copy Copies both the structure and data for this DataTable.
Public method CreateDataReader Returns a DataTableReader corresponding to the data within this DataTable.
Protected method CreateInstance Infrastructure. Creates a new instance of DataTable.
Public method Dispose() Releases all resources used by the MarshalByValueComponent. (Inherited from MarshalByValueComponent.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the MarshalByValueComponent and optionally releases the managed resources. (Inherited from MarshalByValueComponent.)
Public method EndInit Ends the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at run time.
Public method EndLoadData Turns on notifications, index maintenance, and constraints after loading data.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from MarshalByValueComponent.)
Public method GetChanges() Gets a copy of the DataTable that contains all changes made to it since it was loaded or AcceptChanges was last called.
Public method GetChanges(DataRowState) Gets a copy of the DataTable containing all changes made to it since it was last loaded, or since AcceptChanges was called, filtered by DataRowState.
Public method Static member GetDataTableSchema This method returns an XmlSchemaSet instance containing the Web Services Description Language (WSDL) that describes the DataTable for Web Services.
Public method GetErrors Gets an array of DataRow objects that contain errors.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetObjectData Populates a serialization information object with the data needed to serialize the DataTable.
Protected method GetRowType Infrastructure. Gets the row type.
Protected method GetSchema Infrastructure. For a description of this member, see IXmlSerializable.GetSchema.
Public method GetService Gets the implementer of the IServiceProvider. (Inherited from MarshalByValueComponent.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ImportRow Copies a DataRow into a DataTable, preserving any property settings, as well as original and current values.
Public method Load(IDataReader) Fills a DataTable with values from a data source using the supplied IDataReader. If the DataTable already contains rows, the incoming data from the data source is merged with the existing rows.
Public method Load(IDataReader, LoadOption) Fills a DataTable with values from a data source using the supplied IDataReader. If the DataTable already contains rows, the incoming data from the data source is merged with the existing rows according to the value of the loadOption parameter.
Public method Load(IDataReader, LoadOption, FillErrorEventHandler) Fills a DataTable with values from a data source using the supplied IDataReader using an error-handling delegate.
Public method LoadDataRow(Object[], Boolean) Finds and updates a specific row. If no matching row is found, a new row is created using the given values.
Public method LoadDataRow(Object[], LoadOption) Finds and updates a specific row. If no matching row is found, a new row is created using the given values.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Merge(DataTable) Merge the specified DataTable with the current DataTable.
Public method Merge(DataTable, Boolean) Merge the specified DataTable with the current DataTable, indicating whether to preserve changes in the current DataTable.
Public method Merge(DataTable, Boolean, MissingSchemaAction) Merge the specified DataTable with the current DataTable, indicating whether to preserve changes and how to handle missing schema in the current DataTable.
Public method NewRow Creates a new DataRow with the same schema as the table.
Protected method NewRowArray Infrastructure. Returns an array of DataRow.
Protected method NewRowFromBuilder Creates a new row from an existing row.
Protected method OnColumnChanged Raises the ColumnChanged event.
Protected method OnColumnChanging Raises the ColumnChanging event.
Protected method OnPropertyChanging Raises the PropertyChanged event.
Protected method OnRemoveColumn Notifies the DataTable that a DataColumn is being removed.
Protected method OnRowChanged Raises the RowChanged event.
Protected method OnRowChanging Raises the RowChanging event.
Protected method OnRowDeleted Raises the RowDeleted event.
Protected method OnRowDeleting Raises the RowDeleting event.
Protected method OnTableCleared Raises the TableCleared event.
Protected method OnTableClearing Raises the TableClearing event.
Protected method OnTableNewRow Raises the TableNewRow event.
Public method ReadXml(Stream) Reads XML schema and data into the DataTable using the specified Stream.
Public method ReadXml(String) Reads XML schema and data into the DataTable from the specified file.
Public method ReadXml(TextReader) Reads XML schema and data into the DataTable using the specified TextReader.
Public method ReadXml(XmlReader) Reads XML Schema and Data into the DataTable using the specified XmlReader.
Public method ReadXmlSchema(Stream) Reads an XML schema into the DataTable using the specified stream.
Public method ReadXmlSchema(String) Reads an XML schema into the DataTable from the specified file.
Public method ReadXmlSchema(TextReader) Reads an XML schema into the DataTable using the specified TextReader.
Public method ReadXmlSchema(XmlReader) Reads an XML schema into the DataTable using the specified XmlReader.
Protected method ReadXmlSerializable Infrastructure. Reads from an XML stream.
Public method RejectChanges Rolls back all changes that have been made to the table since it was loaded, or the last time AcceptChanges was called.
Public method Reset Resets the DataTable to its original state.
Public method Select() Gets an array of all DataRow objects.
Public method Select(String) Gets an array of all DataRow objects that match the filter criteria.
Public method Select(String, String) Gets an array of all DataRow objects that match the filter criteria, in the specified sort order.
Public method Select(String, String, DataViewRowState) Gets an array of all DataRow objects that match the filter in the order of the sort that match the specified state.
Public method ToString Gets the TableName and DisplayExpression, if there is one as a concatenated string. (Overrides MarshalByValueComponent.ToString().)
Public method WriteXml(Stream) Writes the current contents of the DataTable as XML using the specified Stream.
Public method WriteXml(String) Writes the current contents of the DataTable as XML using the specified file.
Public method WriteXml(TextWriter) Writes the current contents of the DataTable as XML using the specified TextWriter.
Public method WriteXml(XmlWriter) Writes the current contents of the DataTable as XML using the specified XmlWriter.
Public method WriteXml(Stream, Boolean) Writes the current contents of the DataTable as XML using the specified Stream. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(Stream, XmlWriteMode) Writes the current data, and optionally the schema, for the DataTable to the specified file using the specified XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema.
Public method WriteXml(String, Boolean) Writes the current contents of the DataTable as XML using the specified file. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(String, XmlWriteMode) Writes the current data, and optionally the schema, for the DataTable using the specified file and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema.
Public method WriteXml(TextWriter, Boolean) Writes the current contents of the DataTable as XML using the specified TextWriter. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(TextWriter, XmlWriteMode) Writes the current data, and optionally the schema, for the DataTable using the specified TextWriter and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema.
Public method WriteXml(XmlWriter, Boolean) Writes the current contents of the DataTable as XML using the specified XmlWriter.
Public method WriteXml(XmlWriter, XmlWriteMode) Writes the current data, and optionally the schema, for the DataTable using the specified XmlWriter and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema.
Public method WriteXml(Stream, XmlWriteMode, Boolean) Writes the current data, and optionally the schema, for the DataTable to the specified file using the specified XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(String, XmlWriteMode, Boolean) Writes the current data, and optionally the schema, for the DataTable using the specified file and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(TextWriter, XmlWriteMode, Boolean) Writes the current data, and optionally the schema, for the DataTable using the specified TextWriter and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXml(XmlWriter, XmlWriteMode, Boolean) Writes the current data, and optionally the schema, for the DataTable using the specified XmlWriter and XmlWriteMode. To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXmlSchema(Stream) Writes the current data structure of the DataTable as an XML schema to the specified stream.
Public method WriteXmlSchema(String) Writes the current data structure of the DataTable as an XML schema to the specified file.
Public method WriteXmlSchema(TextWriter) Writes the current data structure of the DataTable as an XML schema using the specified TextWriter.
Public method WriteXmlSchema(XmlWriter) Writes the current data structure of the DataTable as an XML schema using the specified XmlWriter.
Public method WriteXmlSchema(Stream, Boolean) Writes the current data structure of the DataTable as an XML schema to the specified stream. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXmlSchema(String, Boolean) Writes the current data structure of the DataTable as an XML schema to the specified file. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXmlSchema(TextWriter, Boolean) Writes the current data structure of the DataTable as an XML schema using the specified TextWriter. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true.
Public method WriteXmlSchema(XmlWriter, Boolean) Writes the current data structure of the DataTable as an XML schema using the specified XmlWriter. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true.
Top

  NameDescription
Public Extension Method AsDataView Creates and returns a LINQ-enabled DataView object. (Defined by DataTableExtensions.)
Public Extension Method AsEnumerable Returns an IEnumerable<T> object, where the generic parameter T is DataRow. This object can be used in a LINQ expression or method query. (Defined by DataTableExtensions.)
Top

  NameDescription
Explicit interface implemetation Private method IListSource.GetList For a description of this member, see IListSource.GetList.
Explicit interface implemetation Private method IXmlSerializable.GetSchema For a description of this member, see IXmlSerializable.GetSchema.
Explicit interface implemetation Private method IXmlSerializable.ReadXml For a description of this member, see IXmlSerializable.ReadXml.
Explicit interface implemetation Private method IXmlSerializable.WriteXml For a description of this member, see IXmlSerializable.WriteXml.
Top

Community Additions

ADD
Show:
© 2014 Microsoft