Share via


SqlDbType Property

Gets or sets the SqlDbType of the parameter.

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

Syntax

'Declaration
<DbProviderSpecificTypePropertyAttribute(True)> _
Public Property SqlDbType As SqlDbType
    Get
    Set
'Usage
Dim instance As SqlCeParameter
Dim value As SqlDbType

value = instance.SqlDbType

instance.SqlDbType = value
[DbProviderSpecificTypePropertyAttribute(true)]
public SqlDbType SqlDbType { get; set; }
[DbProviderSpecificTypePropertyAttribute(true)]
public:
property SqlDbType SqlDbType {
    SqlDbType get ();
    void set (SqlDbType value);
}
[<DbProviderSpecificTypePropertyAttribute(true)>]
member SqlDbType : SqlDbType with get, set
function get SqlDbType () : SqlDbType
function set SqlDbType (value : SqlDbType)

Property Value

Type: System.Data. . :: . .SqlDbType
One of the SqlDbType values. The default is NVarChar.

Remarks

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

The .NET Provider supports the following SqlDbTypes:

  • SqlDbType.TinyInt

  • SqlDbType.SmallInt

  • SqlDbType.Int

  • SqlDbType.BigInt

  • SqlDbType.Real

  • SqlDbType.Float

  • SqlDbType.Money

  • SqlDbType.Bit

  • SqlDbType.Binary

  • SqlDbType.VarBinary

  • SqlDbType.UniqueIdentifier

  • SqlDbType.Image

  • SqlDbType.NText

  • SqlDbType.NChar

  • SqlDbType.NVarChar

  • SqlDbType.Decimal

  • SqlDbType.DateTime

For a list of the supported data types, see the appropriate DbType property.

Examples

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

Dim param As New SqlCeParameter()
param.SqlDbType = SqlDbType.NText
SqlCeParameter param = new SqlCeParameter();
param.SqlDbType = SqlDbType.NText;

See Also

Reference

SqlCeParameter Class

SqlCeParameter Members

System.Data.SqlServerCe Namespace