DataTableMappingCollection.Clear 方法
定义
从集合中删除所有 DataTableMapping 对象。Removes all DataTableMapping objects from the collection.
public:
virtual void Clear();
public void Clear ();
abstract member Clear : unit -> unit
override this.Clear : unit -> unit
Public Sub Clear ()
实现
示例
下面的示例使用 CopyTo 方法将集合导出到对象的数组 DataTableMapping 。The following example uses the CopyTo method to export the collection to an array of DataTableMapping objects. 然后,它将清除集合,并在 true 参数不再持续时返回。It then clears the collection, and returns true if the parameters are no longer persisting. 本示例假定已 DataTableMappingCollection 创建了。This example assumes that a DataTableMappingCollection has already been created.
public void PushIntoArray()
{
// ...
// create DataTableMappingCollection collection mappings
// ...
DataTableMapping[] tables = {};
mappings.CopyTo(tables, 0);
mappings.Clear();
}
Public Sub PushIntoArray()
' ...
' create DataTableMappingCollection collection mappings
' ...
Dim tables() As DataTableMapping
mappings.CopyTo(tables, 0)
mappings.Clear()
End Sub