DataTableMappingCollection.GetByDataSetTable(String) 方法

定义

获取具有指定的 DataSet 表名的 DataTableMapping 对象。Gets the DataTableMapping object with the specified DataSet table name.

public:
 System::Data::Common::DataTableMapping ^ GetByDataSetTable(System::String ^ dataSetTable);
public System.Data.Common.DataTableMapping GetByDataSetTable (string dataSetTable);
member this.GetByDataSetTable : string -> System.Data.Common.DataTableMapping
Public Function GetByDataSetTable (dataSetTable As String) As DataTableMapping

参数

dataSetTable
String

要查找的 DataSet 表的名称(该名称不区分大小写)。The name, which is not case-sensitive, of the DataSet table to find.

返回

DataTableMapping

具有指定的 DataSet 表名的 DataTableMapping 对象。The DataTableMapping object with the specified DataSet table name.

示例

下面的示例搜索 DataTableMapping 集合中的。The following example searches for a DataTableMapping within the collection. 如果该对象存在,则返回该对象。If the object exists, it is returned. 该示例假设 DataTableMappingCollection 已创建一个集合和一个 DataTableMapping 对象。The example assumes that a DataTableMappingCollection collection and a DataTableMapping object have been created.

public void FindDataTableMapping()
{
    // ...
    // create mappings and mapping
    // ...
    if (mappings.IndexOfDataSetTable("datacategories") != -1)
        mapping = mappings.GetByDataSetTable("datacategories");
}
Public Sub FindDataTableMapping()
    ' ...
    ' create mappings and mapping
    ' ...
    If mappings.IndexOfDataSetTable("datacategories") <> - 1 Then
        mapping = mappings.GetByDataSetTable("datacategories")
    End If
End Sub

适用于