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.

可以DbType通过OracleType 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数据类型,默认值AnsiString为。For 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.

适用于

另请参阅