OracleParameter.DbType OracleParameter.DbType OracleParameter.DbType OracleParameter.DbType Property

定义

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

public:
 virtual property System::Data::DbType DbType { System::Data::DbType get(); void set(System::Data::DbType value); };
[System.ComponentModel.Browsable(false)]
public override System.Data.DbType DbType { get; set; }
member this.DbType : System.Data.DbType with get, set
Public Overrides Property DbType As DbType

属性值

DbType 值之一。One of the DbType values. 默认值为 AnsiStringThe default is AnsiString.

实现

异常

示例

下面的示例创建OracleParameter和设置的某些属性。The following example creates an OracleParameter and sets some of its properties.

public void CreateOracleDbParameter() 
 {
    OracleParameter parameter = new OracleParameter();
    parameter.ParameterName = "pDName";
    parameter.DbType = DbType.String;
    parameter.Value = "ENGINEERING";
    parameter.SourceColumn = "DName";
 }

Public Sub CreateOracleDbParameter()
    Dim parameter As New OracleParameter()
    parameter.ParameterName = "pDName"
    parameter.DbType = DbType.String
    parameter.Value = "ENGINEERING"
    parameter.SourceColumn = "DName"
End Sub 

注解

OracleTypeDbType链接。The OracleType and DbType are linked. 因此,设置DbType更改OracleType为支持OracleTypeTherefore, setting the DbType changes the OracleType to a supporting OracleType.

DbTypeOracleType,并Size参数的属性,可以通过设置推断出ValueThe DbType, OracleType, and Size properties of a parameter can be inferred by setting Value. 因此,不需要指定它们。Therefore, you are not required to specify them. 但是,它们不会暴露在OracleParameter属性设置。However, they are not exposed in OracleParameter property settings. 例如,如果已推断出参数的大小,Size语句执行后,不包含推断的值。For example, if the size of the parameter has been inferred, Size does not contain inferred value after statement execution. 有关String数据类型默认值是AnsiStringFor String data types the default is AnsiString.

有关支持的数据类型的列表,请参阅相应OracleType成员。For a list of the supported data types, see the appropriate OracleType member. 有关详细信息,请参阅DataAdapter 参数For more information, see DataAdapter Parameters.

适用于

另请参阅