System.Data.Common Namespace DataTableMappingCollection Class
Returns a DataTableMapping object with the specified DataSetTable name.
[ VB ]
Public Function GetByDataSetTable ( _
ByVal dataSetTable As String _
) As DataTableMapping
[ C# ]
public DataTableMapping GetByDataSetTable (
string dataSetTable
);
[ C++ ]
public: DataTableMapping* GetByDataSetTable (
String* dataSetTable
);
[ JScript ]
public function GetByDataSetTable (
dataSetTable : String
) : DataTableMapping;
- dataSetTable
- The case-insensitive name of the DataSetTable to find.
The DataTableMapping object with the specified DataSetTable name.
Exception Type |
Condition |
ArgumentException |
Thrown if the dataSetTable parameter is a null reference
( Nothing in Visual Basic ). |
The following example demonstrates using the GetByDataSetTable method to return a specified DataTableMapping object.
public void FindDataTableMapping ( DataAdapter myAdapter ) {
// get table mappings
DataTableMappingCollection myTables = myAdapter.TableMappings;
if ( myTables.Contains ( "Employees" ) ) {
DataTableMapping myTable = myTables.GetByDataSetTable ( "tblEmployees" );
}
}
Public Sub FindDataTableMapping ( ByVal myAdapter As DataAdapter )
' get table mappings
Dim myTables As DataTableMappingCollection = myAdapter.TableMappings;
If myTables.Contains ( "Employees" ) Then
Dim myTable As DataTableMapping = myTables.GetByDataSetTable ( "tblEmployees" )
End If
End Sub |
|
C# |
VB |
DataTableMappingCollection Members