Share via


SqlCeParameter.SqlDbType 屬性

取得或設定參數的 SqlDbType

命名空間:  System.Data.SqlServerCe
組件:  System.Data.SqlServerCe (在 System.Data.SqlServerCe.dll 中)

語法

'宣告
<DbProviderSpecificTypePropertyAttribute(True)> _
Public Property SqlDbType As SqlDbType
    Get
    Set
'用途
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)

屬性值

型別:System.Data.SqlDbType
其中一個 SqlDbType 值。預設值為 NVarChar。

備註

SqlDbType 和 DbType 彼此相連結。因此,設定 DbType 會將 SqlDbType 變更為支援的 SqlDbType

SQL Server Compact .NET Provider 支援以下的 SqlDbType:

  • 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

如需支援的資料類型清單,請參閱適當的 DbType 屬性。

範例

下列範例會建立 SqlCeParameter,並設定 SqlDbType 屬性。

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

請參閱

參考

SqlCeParameter 類別

System.Data.SqlServerCe 命名空間