SqlCeParameter.Precision 属性

获取或设置用来表示 Value 属性的最大位数。

命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)

语法

声明
Public Property Precision As Byte
用法
Dim instance As SqlCeParameter
Dim value As Byte

value = instance.Precision

instance.Precision = value
public byte Precision { get; set; }
public:
property unsigned char Precision {
    unsigned char get ();
    void set (unsigned char value);
}
/** @property */
public byte get_Precision ()

/** @property */
public void set_Precision (byte value)
public function get Precision () : byte

public function set Precision (value : byte)
不适用。

属性值

用于表示 Value 属性的最大位数。默认值为 0。

备注

Precision 属性只用于小数和数值输入参数。

示例

下面的示例创建 SqlCeParameter 并设置 Precision 属性。

Dim param As New SqlCeParameter("@Price", SqlDbType.Decimal)
param.Value = 3.1416
param.Precision = 8
param.Scale = 4
SqlCeParameter param = new SqlCeParameter("@Price", SqlDbType.Decimal);
param.Value = 3.1416;
param.Precision = 8;
param.Scale = 4;

平台

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。

版本信息

.NET Framework

受以下版本支持:3.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

SqlCeParameter 类
SqlCeParameter 成员
System.Data.SqlServerCe 命名空间
Scale
Size