This topic has not yet been rated - Rate this topic

DataTableMapping.GetDataTableBySchemaAction Method

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

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)
public DataTable GetDataTableBySchemaAction(
	DataSet dataSet,
	MissingSchemaAction schemaAction
)

Parameters

dataSet
Type: System.Data.DataSet

The DataSet from which to get the DataTable.

schemaAction
Type: System.Data.MissingSchemaAction

One of the MissingSchemaAction values.

Return Value

Type: System.Data.DataTable
A data table.

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

The following example gets the DataTable for a given DataSet. If there is no current table for the DataSet, null is returned. This example assumes that a DataSet and a DataTableMappingCollection collection have been created.

public void CreateDataTable() 
{
    // ... 
    // create dataSet and mapping 
    // ...
    DataTable table = mapping.GetDataTableBySchemaAction
        (dataSet, MissingSchemaAction.Ignore);
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.