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 提供程序支持以下 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
有关受支持的数据类型的列表,请参阅相应的 DbType 属性。
示例
下面的示例创建了 SqlCeParameter 并设置了 SqlDbType 属性。
Dim param As New SqlCeParameter()
param.SqlDbType = SqlDbType.NText
SqlCeParameter param = new SqlCeParameter();
param.SqlDbType = SqlDbType.NText;