System.Data.Common Namespace DataColumnMappingCollection Class
Returns a DataColumnMapping object with the specified DataSetColumn name.
[ VB ]
Public Function GetByDataSetColumn ( _
ByVal dataSetColumn As String _
) As DataColumnMapping
[ C# ]
public DataColumnMapping GetByDataSetColumn (
string dataSetColumn
);
[ C++ ]
public: DataColumnMapping* GetByDataSetColumn (
String* dataSetColumn
);
[ JScript ]
public function GetByDataSetColumn (
dataSetColumn : String
) : DataColumnMapping;
- dataSetColumn
- The case-insensitive name of the DataSetColumn to find.
The DataColumnMapping object with the specified DataSetColumn name.
Exception Type |
Condition |
ArgumentException |
Thrown if the dataSetColumn parameter is a null reference
( Nothing in Visual Basic ). |
The following example demonstrates using the GetByDataSetColumn method to return a specified DataColumnMapping object.
public void FindDataColumnMapping ( DataTableMapping myTableMap ) {
// get column mappings
DataColumnMappingCollection myFieldsMaps = myTableMap.ColumnMappings;
if ( myFieldsMaps.Contains ( "Description" ) ) {
DataColumnMapping myFieldMap =
myFieldsMaps.GetByDataSetColumn ( "datadescription" );
}
}
Public Sub FindDataColumnMapping ( ByVal myTableMap As DataTableMapping )
' get column mappings
Dim myFieldsMaps As DataColumnMappingCollection = myTableMap.ColumnMappings;
If myFieldsMaps.Contains ( "Description" ) Then
Dim myFieldMap As DataColumnMapping = _
myFieldsMaps.GetByDataSetColumn ( "datadescription" )
End If
End Sub |
|
C# |
VB |
DataColumnMappingCollection Members