DbParameterCollection DbParameterCollection DbParameterCollection DbParameterCollection Class

定义

DbCommand 相关的参数集合的基类。The base class for a collection of parameters relevant to a DbCommand.

public ref class DbParameterCollection abstract : MarshalByRefObject, System::Collections::IList, System::Data::IDataParameterCollection
public abstract class DbParameterCollection : MarshalByRefObject, System.Collections.IList, System.Data.IDataParameterCollection
type DbParameterCollection = class
    inherit MarshalByRefObject
    interface IDataParameterCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public MustInherit Class DbParameterCollection
Inherits MarshalByRefObject
Implements IDataParameterCollection, IList
继承
DbParameterCollectionDbParameterCollectionDbParameterCollectionDbParameterCollection
派生
实现

构造函数

DbParameterCollection() DbParameterCollection() DbParameterCollection() DbParameterCollection()

初始化 DbParameterCollection 类的新实例。Initializes a new instance of the DbParameterCollection class.

属性

Count Count Count Count

指定集合中项的数目。Specifies the number of items in the collection.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

指定集合是否为固定大小。Specifies whether the collection is a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

指定集合是否为只读。Specifies whether the collection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

指定是否同步集合。Specifies whether the collection is synchronized.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置指定索引处的 DbParameterGets or sets the DbParameter at the specified index.

Item[String] Item[String] Item[String] Item[String]

获取或设置具有指定名称的 DbParameterGets or sets the DbParameter with the specified name.

SyncRoot SyncRoot SyncRoot SyncRoot

指定将用于同步集合访问的 ObjectSpecifies the Object to be used to synchronize access to the collection.

方法

Add(Object) Add(Object) Add(Object) Add(Object)

将指定的 DbParameter 对象添加到 DbParameterCollection 中。Adds the specified DbParameter object to the DbParameterCollection.

AddRange(Array) AddRange(Array) AddRange(Array) AddRange(Array)

将具有指定值的项的数组添加到 DbParameterCollectionAdds an array of items with the specified values to the DbParameterCollection.

Clear() Clear() Clear() Clear()

将所有 DbParameter 值从 DbParameterCollection 中移除。Removes all DbParameter values from the DbParameterCollection.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

指示集合中是否包含具有指定 ValueDbParameterIndicates whether a DbParameter with the specified Value is contained in the collection.

Contains(String) Contains(String) Contains(String) Contains(String)

指示具有指定名称的 DbParameter 是否存在于集合中。Indicates whether a DbParameter with the specified name exists in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

将项的数组复制到从指定索引开始的集合。Copies an array of items to the collection starting at the specified index.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

公开 GetEnumerator() 方法,该方法支持 .NET Framework 数据提供程序对集合进行简单的迭代。Exposes the GetEnumerator() method, which supports a simple iteration over a collection by a .NET Framework data provider.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetParameter(Int32) GetParameter(Int32) GetParameter(Int32) GetParameter(Int32)

返回位于集合中指定索引处的 DbParameter 对象。Returns the DbParameter object at the specified index in the collection.

GetParameter(String) GetParameter(String) GetParameter(String) GetParameter(String)

返回具有指定名称的 DbParameter 对象。Returns DbParameter the object with the specified name.

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

返回指定的 DbParameter 对象的索引。Returns the index of the specified DbParameter object.

IndexOf(String) IndexOf(String) IndexOf(String) IndexOf(String)

返回具有指定名称的 DbParameter 对象的索引。Returns the index of the DbParameter object with the specified name.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

将具有指定名称的 DbParameter 对象的指定索引插入指定索引处的集合中。Inserts the specified index of the DbParameter object with the specified name into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

从集合中移除指定的 DbParameter 对象。Removes the specified DbParameter object from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

从集合中删除位于指定位置的 DbParameter 对象。Removes the DbParameter object at the specified from the collection.

RemoveAt(String) RemoveAt(String) RemoveAt(String) RemoveAt(String)

从集合中删除具有指定名称的 DbParameter 对象。Removes the DbParameter object with the specified name from the collection.

SetParameter(Int32, DbParameter) SetParameter(Int32, DbParameter) SetParameter(Int32, DbParameter) SetParameter(Int32, DbParameter)

将指定索引处的 DbParameter 对象设置为新值。Sets the DbParameter object at the specified index to a new value.

SetParameter(String, DbParameter) SetParameter(String, DbParameter) SetParameter(String, DbParameter) SetParameter(String, DbParameter)

将具有指定名称的 DbParameter 对象设置为新值。Sets the DbParameter object with the specified name to a new value.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized
IDataParameterCollection.Item[String] IDataParameterCollection.Item[String] IDataParameterCollection.Item[String] IDataParameterCollection.Item[String]

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

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

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

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

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

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅