SqlCeParameter.DbType Property

Gets or sets the DbType of the parameter.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

Syntax

'Declaration
Public Overrides Property DbType As DbType
    Get
    Set
'Usage
Dim instance As SqlCeParameter
Dim value As DbType

value = instance.DbType

instance.DbType = value
public override DbType DbType { get; set; }
public:
virtual property DbType DbType {
    DbType get () override;
    void set (DbType value) override;
}
abstract DbType : DbType with get, set
override DbType : DbType with get, set
override function get DbType () : DbType
override function set DbType (value : DbType)

Property Value

Type: System.Data.DbType
One of the DbType values. The default is String.

Implements

IDataParameter.DbType

Exceptions

Exception Condition
ArgumentOutOfRangeException

The property was not set to a valid DbType.

Remarks

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

The SQL Server Compact .NET Provider supports the following values of DbType:

Examples

The following example creates a SqlCeParameter and sets the DbType property.

Dim param As New SqlCeParameter()
param.DbType = DbType.String
SqlCeParameter param = new SqlCeParameter();
param.DbType = DbType.String;

See Also

Reference

SqlCeParameter Class

System.Data.SqlServerCe Namespace

SqlCeType