Redigeeri

Jagamisviis:


OleDbParameter.DbType Property

Definition

Gets or sets the DbType of the parameter.

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

Property Value

One of the DbType values. The default is String.

Implements

Attributes

Exceptions

The property was not set to a valid DbType.

Examples

The following example creates an OleDbParameter and sets some of its properties.

public void CreateOleDbParameter()
 {
    OleDbParameter parameter = new OleDbParameter("Description", OleDbType.VarChar, 88);
    parameter.Direction = ParameterDirection.Output;
 }
Public Sub CreateOleDbParameter()
    Dim parameter As New OleDbParameter("Description", OleDbType.VarChar, 88)
    parameter.Direction = ParameterDirection.Output
End Sub

Remarks

The OleDbType and DbType are linked. Therefore, setting the DbType changes the OleDbType to a supporting OleDbType.

For a list of the supported data types, see the appropriate OleDbType member. For more information, see DataAdapter Parameters.

Applies to

See also