Fills the data set with the schema based upon the chosen SchemaType and a given source table.
[Visual Basic] Overloads Overridable Public Function FillDataSetSchema( _ ByVal dataSet As DataSet, _ ByVal schemaType As SchemaType, _ ByVal srcTable As String _ ) As DataTable () [C#] public virtual DataTable[] FillDataSetSchema( DataSet dataSet, SchemaType schemaType, string srcTable ); [C++] public: virtual DataTable* FillDataSetSchema( DataSet* dataSet, SchemaType schemaType, String* srcTable ) []; [JScript] public function FillDataSetSchema( dataSet : DataSet, schemaType : SchemaType, srcTable : String ) : DataTable[];
A DataTable filled with records from the DataSet.
Exception Type | Condition |
---|---|
FillDataSetSchemaRequiresSourceTable | A source table could not be found to get the schema from. |
Notes to Inheritors: When overriding FillDataSetSchema in a derived class, be sure to call the base class's FillDataSetSchema method.
The following example fills a DataSet with the schema only, while filling a DataTable with records, when provided a source table.
[Visual Basic]
Public Sub MyFillDataTableAndSet(myDataTable As DataTable, _ myDataSet As DataSet, _ myDataSetComm As ADODataSetCommand, mySrcTable As String) ' Create a MessageBox to show the contents of myDataTable in Dim myMsgBox As MessageBox ' Populate myDataTable with records and myDataSet with schema myDataTable = myDataSetComm.FillDataSetSchema myDataSet, _ SchemaType.Source, mySrcTable ' Display the contents of myDataTable myMsgBox myDataTable.ToString End Sub
DBDataSetCommand Class | DBDataSetCommand Members | System.Data.Internal Namespace | DBDataSetCommand.FillDataSetSchema Overload List