Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCeParameter.SqlDbType Property

Gets or sets the SqlDbType of the parameter.

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

[DbProviderSpecificTypePropertyAttribute(true)]
public SqlDbType SqlDbType { get; set; }

Property Value

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

The 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 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.

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

SqlCeParameter param = new SqlCeParameter();
param.SqlDbType = SqlDbType.NText;


Show:
© 2015 Microsoft