DataTableMappingCollection 类
本文内容
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
DataTableMapping 对象的集合。 此类不能被继承。
public ref class DataTableMappingCollection sealed : MarshalByRefObject, System::Collections::IList, System::Data::ITableMappingCollection
public ref class DataTableMappingCollection sealed : MarshalByRefObject, System::Data::ITableMappingCollection
[System.ComponentModel.ListBindable(false)]
public sealed class DataTableMappingCollection : MarshalByRefObject, System.Collections.IList, System.Data.ITableMappingCollection
[System.ComponentModel.ListBindable(false)]
public sealed class DataTableMappingCollection : MarshalByRefObject, System.Data.ITableMappingCollection
[<System.ComponentModel.ListBindable(false)>]
type DataTableMappingCollection = class
inherit MarshalByRefObject
interface ICollection
interface IEnumerable
interface IList
interface ITableMappingCollection
[<System.ComponentModel.ListBindable(false)>]
type DataTableMappingCollection = class
inherit MarshalByRefObject
interface ITableMappingCollection
interface IList
interface ICollection
interface IEnumerable
Public NotInheritable Class DataTableMappingCollection
Inherits MarshalByRefObject
Implements IList, ITableMappingCollection
Public NotInheritable Class DataTableMappingCollection
Inherits MarshalByRefObject
Implements ITableMappingCollection
- 继承
- 属性
- 实现
以下示例使用 OleDbDataAdapter to AddDataTableMapping 对象对其 TableMappings 集合,然后显示这些映射的源表的列表。 此示例假定 OleDbDataAdapter 已创建 。
public void ShowTableMappings()
{
// ...
// create adapter
// ...
adapter.TableMappings.Add("Categories","DataCategories");
adapter.TableMappings.Add("Orders","DataOrders");
adapter.TableMappings.Add("Products","DataProducts");
string message = "Table Mappings:\n";
for(int i=0;i < adapter.TableMappings.Count;i++)
{
message += i.ToString() + " "
+ adapter.TableMappings[i].ToString() + "\n";
}
Console.WriteLine(message);
}
Public Sub ShowTableMappings()
' ...
' create adapter
' ...
adapter.TableMappings.Add("Categories", "DataCategories")
adapter.TableMappings.Add("Orders", "DataOrders")
adapter.TableMappings.Add("Products", "DataProducts")
Dim message As String = "Table Mappings:" & ControlChars.Cr
Dim i As Integer
For i = 0 To adapter.TableMappings.Count - 1
message &= i.ToString() & " " _
& adapter.TableMappings(i).ToString() & ControlChars.Cr
Next i
Console.WriteLine(message)
End Sub
Data |
初始化 DataTableMappingCollection 类的新实例。 此新实例为空,即它尚未包含任何 DataTableMapping 对象。 |
Count |
获取集合中 DataTableMapping 对象的数量。 |
Item[Int32] |
获取或设置位于指定索引处的 DataTableMapping 对象。 |
Item[String] |
获取或设置具有指定源表名称的 DataTableMapping 对象。 |
ICollection. |
获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。 |
ICollection. |
获取可用于同步对 ICollection 的访问的对象。 |
IList. |
获取一个值,该值指示 IList 是否具有固定大小。 |
IList. |
获取一个值,该值指示 IList 是否为只读。 |
IList. |
获取或设置指定索引处的集合中的项。 |
ITable |
向集合添加表映射。 |
ITable |
获取具有指定的 DataSet 表名的 TableMapping 对象。 |
ITable |
获取或设置具有指定 SourceTable 名称的 ITableMapping 的实例。 |
Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
Of |
根据指定类型筛选 IEnumerable 的元素。 |
As |
启用查询的并行化。 |
As |
将 IEnumerable 转换为 IQueryable。 |
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |