Gets how a source table is to be mapped to a data set table.
[Visual Basic] Public ReadOnly Property TableMappings As DataTableMappings [C#] public DataTableMappings TableMappings {get;} [C++] public: __property DataTableMappings* get_TableMappings(); [JScript] public function get TableMappings() : DataTableMappings;
A collection that provides the master mapping between the returned records and the DataSet. The default value is an empty collection.
The DataSetCommand uses only the mappings for the source table named "Table". All select, insert, delete, and update commands returning data must do so using consistent column naming. The column names returned in the records must be unique, otherwise columns with duplicate names overwrites previous data. On Update only the table mapped to the source table named "Table" will have its changes reconciled.
The following example shows how a source table is to be mapped to a data set table.
[Visual Basic]
Public Sub MyShowTableMap() Dim myDataSetComm As ADODataSetCommand ' Initialize the ADODataSetCommand myDataSetComm = New ADODataSetCommand ' Create an array of DataTableMapping Dim myTableMapArray() As DataTableMapping ' Create temporary table map for concatention loop Dim tmpTableMap As DataTableMapping ' Create string to concatenate mappings to Dim myTableMapString As String ' Create MessageBox to show table mappings in Dim myMsgBox As MessageBox ' get table mapping myTableMapArray = myDataSetComm.TableMappings.All ' initialize myTableMapString myTableMapString = "" ' loop to concatenate all mappings into string For Each tmpTableMap In myTableMapArray myTableMapString += tmpTableMap.ToString + " " Next ' display all mappings in MessageBox myMsgBox.Show myTableMapString, "Current Table Mappings" End Sub
DataSetCommand Class | DataSetCommand Members | System.Data.Internal Namespace