Partilhar via


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
'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;
}
/** @property */
public DbType get_DbType ()

/** @property */
public void set_DbType (DbType value)
public override function get DbType () : DbType

public override function set DbType (value : DbType)
Not applicable.

Property Value

One of the DbType values. The default is String.

Exceptions

Exception type 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 Edition .NET Provider supports the following values of DbType:

Example

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;

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

SqlCeParameter Class
SqlCeParameter Members
System.Data.SqlServerCe Namespace
SqlCeType