共用方式為


SqlCeParameter 建構 (String, SqlDbType, Int32, Boolean, Byte, Byte, String, DataRowVersion, Object)

使用參數名稱、資料類型、長度和其他屬性,初始化 SqlCeParameter 類別的新執行個體。SQL Server Compact 3.5 只支援輸入參數。

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

語法

'宣告
Public Sub New ( _
    parameterName As String, _
    dbType As SqlDbType, _
    size As Integer, _
    isNullable As Boolean, _
    precision As Byte, _
    scale As Byte, _
    sourceColumn As String, _
    sourceVersion As DataRowVersion, _
    value As Object _
)
'用途
Dim parameterName As String
Dim dbType As SqlDbType
Dim size As Integer
Dim isNullable As Boolean
Dim precision As Byte
Dim scale As Byte
Dim sourceColumn As String
Dim sourceVersion As DataRowVersion
Dim value As Object

Dim instance As New SqlCeParameter(parameterName, _
    dbType, size, isNullable, precision, _
    scale, sourceColumn, sourceVersion, _
    value)
public SqlCeParameter(
    string parameterName,
    SqlDbType dbType,
    int size,
    bool isNullable,
    byte precision,
    byte scale,
    string sourceColumn,
    DataRowVersion sourceVersion,
    Object value
)
public:
SqlCeParameter(
    String^ parameterName, 
    SqlDbType dbType, 
    int size, 
    bool isNullable, 
    unsigned char precision, 
    unsigned char scale, 
    String^ sourceColumn, 
    DataRowVersion sourceVersion, 
    Object^ value
)
new : 
        parameterName:string * 
        dbType:SqlDbType * 
        size:int * 
        isNullable:bool * 
        precision:byte * 
        scale:byte * 
        sourceColumn:string * 
        sourceVersion:DataRowVersion * 
        value:Object -> SqlCeParameter
public function SqlCeParameter(
    parameterName : String, 
    dbType : SqlDbType, 
    size : int, 
    isNullable : boolean, 
    precision : byte, 
    scale : byte, 
    sourceColumn : String, 
    sourceVersion : DataRowVersion, 
    value : Object
)

參數

備註

SizePrecision 是從 dataType 參數的值推斷而來 (如果尚未在 size 和 precision 參數中明確設定)。

範例

下列範例會建立 SqlCeParameter,並顯示 ParameterName

Dim param As New SqlCeParameter("@Description", SqlDbType.NVarChar, 11, True, 0, 0, "Description", DataRowVersion.Current, "garden hose")
param.IsNullable = True
SqlCeParameter param = new SqlCeParameter(
    "@Description", SqlDbType.NVarChar, 11, true, 0, 0,
    "Description", DataRowVersion.Current, "garden hose");

param.IsNullable = true;

請參閱

參考

SqlCeParameter類別

SqlCeParameter 成員

SqlCeParameter 多載

System.Data.SqlServerCe 命名空間