Export (0) Print
Expand All

DataTableMapping.GetDataTableBySchemaAction Method

Gets the current DataTable for the specified DataSet using the specified MissingSchemaAction value.

[Visual Basic]
Public Function GetDataTableBySchemaAction( _
   ByVal dataSet As DataSet, _
   ByVal schemaAction As MissingSchemaAction _
) As DataTable
[C#]
public DataTable GetDataTableBySchemaAction(
 DataSet dataSet,
 MissingSchemaAction schemaAction
);
[C++]
public: DataTable* GetDataTableBySchemaAction(
 DataSet* dataSet,
 MissingSchemaAction schemaAction
);
[JScript]
public function GetDataTableBySchemaAction(
   dataSet : DataSet,
 schemaAction : MissingSchemaAction
) : DataTable;

Parameters

dataSet
The DataSet from which to get the DataTable.
schemaAction
One of the MissingSchemaAction values.

Return Value

A DataTable.

Remarks

If the DataTable does not exist, the specified MissingSchemaAction is taken.

Example

[Visual Basic, C#, C++] The following example gets the DataTable for a given DataSet. If there is no current table for the DataSet, a null reference (Nothing in Visual Basic) is returned. This example assumes that a DataSet and a DataTableMappingCollection collection have been created.

[Visual Basic] 
Public Sub CreateDataTable()
    ' ...
    ' create myDataSet and myNewMapping
    ' ...
    Dim myCurrentTable As DataTable = myNewMapping.GetDataTableBySchemaAction _
       (myDataSet, MissingSchemaAction.Ignore)
End Sub

[C#] 
public void CreateDataTable() {
   // ...
   // create myDataSet and myNewMapping
   // ...
   DataTable myCurrentTable = myNewMapping.GetDataTableBySchemaAction
      (myDataSet, MissingSchemaAction.Ignore);
}

[C++] 
void CreateDataTable() {
   // ...
   // create myDataSet and myNewMapping
   // ...
    DataTable* myCurrentTable = myNewMapping->GetDataTableBySchemaAction(myDataSet, MissingSchemaAction::Ignore);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataTableMapping Class | DataTableMapping Members | System.Data.Common Namespace

Show:
© 2014 Microsoft