DataAdapter.TableMappings Özellik
Tanım
public:
property System::Data::Common::DataTableMappingCollection ^ TableMappings { System::Data::Common::DataTableMappingCollection ^ get(); };
public System.Data.Common.DataTableMappingCollection TableMappings { get; }
[System.Data.DataSysDescription("DataAdapter_TableMappings")]
public System.Data.Common.DataTableMappingCollection TableMappings { get; }
member this.TableMappings : System.Data.Common.DataTableMappingCollection
[<System.Data.DataSysDescription("DataAdapter_TableMappings")>]
member this.TableMappings : System.Data.Common.DataTableMappingCollection
Public ReadOnly Property TableMappings As DataTableMappingCollection
Özellik Değeri
Döndürülen kayıtlar ve ile arasında ana eşleme sağlayan bir koleksiyon DataSet .A collection that provides the master mapping between the returned records and the DataSet. Varsayılan değer boş bir koleksiyondur.The default value is an empty collection.
- Öznitelikler
Örnekler
Aşağıdaki örnek türetilmiş bir sınıfı kullanarak OleDbDataAdapter DataTableMapping koleksiyonuna nesne ekler TableMappings ve bu eşlenmiş kaynak tablolarının bir listesini görüntüler.The following example uses a derived class, OleDbDataAdapter, to add DataTableMapping objects to its TableMappings collection and display a list of those mapped source tables. Bu örnek OleDbDataAdapter , daha önce oluşturulmuş olduğunu varsayar.This example assumes that an OleDbDataAdapter has already been created.
public void ShowTableMappings() {
// ...
// create myDataAdapter
// ...
myDataAdapter.TableMappings.Add("Categories","DataCategories");
myDataAdapter.TableMappings.Add("Orders","DataOrders");
myDataAdapter.TableMappings.Add("Products","DataProducts");
string myMessage = "Table Mappings:\n";
for(int i=0;i < myDataAdapter.TableMappings.Count;i++) {
myMessage += i.ToString() + " "
+ myDataAdapter.TableMappings[i].ToString() + "\n";
}
MessageBox.Show(myMessage);
}
Public Sub ShowTableMappings()
' ...
' create myDataAdapter
' ...
myDataAdapter.TableMappings.Add("Categories", "DataCategories")
myDataAdapter.TableMappings.Add("Orders", "DataOrders")
myDataAdapter.TableMappings.Add("Products", "DataProducts")
Dim myMessage As String = "Table Mappings:" + ControlChars.Cr
Dim i As Integer
For i = 0 To myDataAdapter.TableMappings.Count - 1
myMessage += i.ToString() + " " _
+ myDataAdapter.TableMappings(i).ToString() + ControlChars.Cr
Next i
MessageBox.Show(myMessage)
End Sub
Açıklamalar
Değişiklikleri mutabık kılma sırasında, DataAdapter DataTableMappingCollection veri kaynağı tarafından kullanılan sütun adlarını, tarafından kullanılan sütun adlarıyla ilişkilendirmek için koleksiyonunu kullanır DataSet .When reconciling changes, the DataAdapter uses the DataTableMappingCollection collection to associate the column names used by the data source with the column names used by the DataSet.