This documentation is archived and is not being maintained.

ITableMapping.ColumnMappings Property

Gets the derived DataColumnMappingCollection for the DataTable.

[Visual Basic]
ReadOnly Property ColumnMappings As IColumnMappingCollection
[C#]
IColumnMappingCollection ColumnMappings {get;}
[C++]
__property IColumnMappingCollection* get_ColumnMappings();
[JScript]
function get ColumnMappings() : IColumnMappingCollection;

Property Value

A DataColumnMappingCollection.

Example

[Visual Basic, C#, C++] The following example creates an instance of the derived class, DataTableMapping, sets some of its properties, and copies its ColumnMappings to an array. This example assumes that a DataColumnMappingCollection has been created.

[Visual Basic] 
Public Sub CreateDataTableMapping()
    ' ...
    ' create myColumnMappings
    ' ...
    Dim myNewColumnArray() As DataColumnMapping
    ' Copy mappings to array
    myColumnMappings.CopyTo(myNewColumnArray, 0)
    Dim myNewMapping As New DataTableMapping _
       ("Categories", "DataCategories", myNewColumnArray)
End Sub

[C#] 
public void CreateDataTableMapping() {
   // ...
   // create myColumnMappings
   // ...
   DataColumnMapping[] myNewColumnArray = {};
   // Copy mappings to array    
   myColumnMappings.CopyTo(myNewColumnArray, 0);
   DataTableMapping myNewMapping =
      new DataTableMapping("Categories", "DataCategories", myNewColumnArray);    
}

[C++] 
void CreateDataTableMapping() {
   // ...
   // create myColumnMappings
   // ...
   DataColumnMapping* myNewColumnArray[] = new DataColumnMapping*[0];
   // Copy mappings to array
   myColumnMappings->CopyTo(myNewColumnArray, 0);
   DataTableMapping* myNewMapping =
      new DataTableMapping(S"Categories", S"DataCategories", myNewColumnArray);
}

[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

ITableMapping Interface | ITableMapping Members | System.Data Namespace

Show: