DbParameter DbParameter DbParameter DbParameter Class


表示 DbCommand 的参数,还可表示该参数到一个 DataSet 列的映射。Represents a parameter to a DbCommand and optionally, its mapping to a DataSet column. 有关参数的详细信息,请参阅配置参数和参数数据类型For more information on parameters, see Configuring Parameters and Parameter Data Types.

public ref class DbParameter abstract : MarshalByRefObject, System::Data::IDbDataParameter
public abstract class DbParameter : MarshalByRefObject, System.Data.IDbDataParameter
type DbParameter = class
    inherit MarshalByRefObject
    interface IDbDataParameter
    interface IDataParameter
Public MustInherit Class DbParameter
Inherits MarshalByRefObject
Implements IDbDataParameter


DbParameter() DbParameter() DbParameter() DbParameter()

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


DbType DbType DbType DbType

获取或设置参数的 DbTypeGets or sets the DbType of the parameter.

Direction Direction Direction Direction

获取或设置一个值,该值指示参数是只可输入的参数、只可输出的参数、双向参数还是存储过程返回值参数。Gets or sets a value that indicates whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.

IsNullable IsNullable IsNullable IsNullable

获取或设置一个值,该值指示参数是否接受 null 值。Gets or sets a value that indicates whether the parameter accepts null values.

ParameterName ParameterName ParameterName ParameterName

获取或设置 DbParameter 的名称。Gets or sets the name of the DbParameter.

Precision Precision Precision Precision

获取或设置用于表示 Value 属性的最大位数。Gets or sets the maximum number of digits used to represent the Value property.

Scale Scale Scale Scale

获取或设置所解析的 Value 的小数位数。Gets or sets the number of decimal places to which Value is resolved.

Size Size Size Size

获取或设置列中的数据的最大大小(以字节为单位)。Gets or sets the maximum size, in bytes, of the data within the column.

SourceColumn SourceColumn SourceColumn SourceColumn

获取或设置源列的名称,该源列映射到 DataSet 并用于加载或返回 ValueGets or sets the name of the source column mapped to the DataSet and used for loading or returning the Value.

SourceColumnNullMapping SourceColumnNullMapping SourceColumnNullMapping SourceColumnNullMapping

设置或获取一个值,该值指示源列是否可以为 null。Sets or gets a value which indicates whether the source column is nullable. 通过此操作, DbCommandBuilder 能够为可以为 null 的列正确地生成 Update 语句。This allows DbCommandBuilder to correctly generate Update statements for nullable columns.

SourceVersion SourceVersion SourceVersion SourceVersion

获取或设置在加载 DataRowVersion 时使用的 ValueGets or sets the DataRowVersion to use when you load Value.

Value Value Value Value

获取或设置参数的值。Gets or sets the value of the parameter.


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)
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)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

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

(Inherited from MarshalByRefObject)
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)
ResetDbType() ResetDbType() ResetDbType() ResetDbType()

将 DbType 属性重置为其原始设置。Resets the DbType property to its original settings.

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

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

(Inherited from Object)


IDataParameter.SourceVersion IDataParameter.SourceVersion IDataParameter.SourceVersion IDataParameter.SourceVersion
IDbDataParameter.Precision IDbDataParameter.Precision IDbDataParameter.Precision IDbDataParameter.Precision

指示数值参数的精度。Indicates the precision of numeric parameters.

IDbDataParameter.Scale IDbDataParameter.Scale IDbDataParameter.Scale IDbDataParameter.Scale

有关此成员的说明,请参见 ScaleFor a description of this member, see Scale.