asp.net.ph

DataTableMapping GetDataTableBySchemaAction Method

System.Data.Common Namespace   DataTableMapping Class


Returns a DataTable for a given DataSet and MissingSchemaAction.

[ VB ]
Public Function GetDataTableBySchemaAction ( _
   ByVal dataSet As DataSet, _
   ByVal schemaAction As MissingMappingAction _
) As DataTable

[ C# ]
public DataTable GetDataTableBySchemaAction (
   DataSet dataSet,
   MissingMappingAction schemaAction
);

[ C++ ]
public: DataTable* GetDataTableBySchemaAction (
   DataSet* dataSet,
   MissingMappingAction schemaAction
);

[ JScript ]
public function GetDataTableBySchemaAction (
   dataSet : DataSet,
   schemaAction : MissingMappingAction
) : DataTable;

Parameters

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

Return Value

A DataTable.

Remarks

If the DataTable does not exist, the following happens for a given MissingSchemaAction:

MissingSchemaAction Action Taken
Error An exception is thrown.
Ignore Returns a null.
Add A DataTable is created with the name from the DataSetTable property, but not added to the DataSet.

Example

The following example gets a DataTable for a given DataSet. If no table exists, a null reference is returned.

void CreateDataTable ( DataSet myDataSet ) {
   DataTable currentCol = myMap.GetDataTableBySchemaAction (
      myDataSet, MissingSchemaAction.Ignore );
}
  C# VB

See Also

DataTableMapping Members 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