IDataParameterCollection 接口

定义

收集与 Command 对象相关的所有参数以及这些参数到 DataSet 列的映射,并由访问数据源的 .NET Framework 数据提供程序实现。Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET Framework data providers that access data sources.

public interface class IDataParameterCollection : System::Collections::IList
public interface IDataParameterCollection : System.Collections.IList
type IDataParameterCollection = interface
    interface IList
    interface ICollection
    interface IEnumerable
Public Interface IDataParameterCollection
Implements IList
派生
实现

注解

IDataParameterCollection接口允许继承类实现参数集合。The IDataParameterCollection interface allows an inheriting class to implement a Parameter collection. 有关参数类的详细信息, 请参阅配置参数和参数数据类型For more information about Parameter classes, see Configuring Parameters and Parameter Data Types.

应用程序不会直接创建IDataParameterCollection接口的实例, 而是创建继承IDataParameterCollection的类的实例。An application does not create an instance of the IDataParameterCollection interface directly, but creates an instance of a class that inherits IDataParameterCollection.

继承IDataParameterCollection的类必须实现继承成员, 并且通常定义其他成员来添加特定于提供程序的功能。Classes that inherit IDataParameterCollection must implement the inherited members, and typically define additional members to add provider-specific functionality. 例如, IDataParameterCollection接口定义RemoveAt方法的一个实现。For example, the IDataParameterCollection interface defines one implementation of the RemoveAt method. 进而, OleDbParameterCollection该类继承了此方法, 并定义了的RemoveAt两个其他重载。In turn, the OleDbParameterCollection class inherits this method, and defines two additional overloads of RemoveAt.

实施者说明

IDataParameterCollection接口继承时, 应实现以下构造函数。When you inherit from the IDataParameterCollection interface, you should implement the following constructor.

Item 说明Description
PrvParameterCollection()PrvParameterCollection() 创建一个空的 PrvParameterCollection 类。Creates an empty PrvParameterCollection class.

属性

Count

获取 ICollection 中包含的元素数。Gets the number of elements contained in the ICollection.

(继承自 ICollection)
IsFixedSize

获取一个值,该值指示 IList 是否具有固定大小。Gets a value indicating whether the IList has a fixed size.

(继承自 IList)
IsReadOnly

获取一个值,该值指示 IList 是否为只读。Gets a value indicating whether the IList is read-only.

(继承自 IList)
IsSynchronized

获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(继承自 ICollection)
Item[Int32]

获取或设置指定索引处的元素。Gets or sets the element at the specified index.

(继承自 IList)
Item[String]

获取或设置指定索引处的参数。Gets or sets the parameter at the specified index.

SyncRoot

获取可用于同步对 ICollection 的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

(继承自 ICollection)

方法

Add(Object)

将某项添加到 IList 中。Adds an item to the IList.

(继承自 IList)
Clear()

IList 中移除所有项。Removes all items from the IList.

(继承自 IList)
Contains(Object)

确定 IList 是否包含特定值。Determines whether the IList contains a specific value.

(继承自 IList)
Contains(String)

获取一个值,该值指示集合中的参数是否具有指定的名称。Gets a value indicating whether a parameter in the collection has the specified name.

CopyTo(Array, Int32)

从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。Copies the elements of the ICollection to an Array, starting at a particular Array index.

(继承自 ICollection)
GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

(继承自 IEnumerable)
IndexOf(Object)

确定 IList 中特定项的索引。Determines the index of a specific item in the IList.

(继承自 IList)
IndexOf(String)

在集合中获取 IDataParameter 的位置。Gets the location of the IDataParameter within the collection.

Insert(Int32, Object)

IList 中的指定索引处插入一个项。Inserts an item to the IList at the specified index.

(继承自 IList)
Remove(Object)

IList 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the IList.

(继承自 IList)
RemoveAt(Int32)

移除位于指定索引处的 IList 项。Removes the IList item at the specified index.

(继承自 IList)
RemoveAt(String)

从集合中移除 IDataParameterRemoves the IDataParameter from the collection.

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于