Share via


SqlCeParameter Constructor (String, SqlDbType, Int32, Boolean, Byte, Byte, String, DataRowVersion, Object)

Initializes a new instance of the SqlCeParameter class with the parameter name, data type, length, and other properties. SQL Server Compact 3.5 SP1 supports only input parameters.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

Syntax

'Declaration
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 _
)
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
)
public SqlCeParameter (
    String parameterName, 
    SqlDbType dbType, 
    int size, 
    boolean isNullable, 
    byte precision, 
    byte scale, 
    String sourceColumn, 
    DataRowVersion sourceVersion, 
    Object value
)
public function SqlCeParameter (
    parameterName : String, 
    dbType : SqlDbType, 
    size : int, 
    isNullable : boolean, 
    precision : byte, 
    scale : byte, 
    sourceColumn : String, 
    sourceVersion : DataRowVersion, 
    value : Object
)

Parameters

  • parameterName
    The name of the parameter.
  • size
    The length of the parameter.
  • isNullable
    true if the value of the field can be null; otherwise, false.
  • precision
    The total number of digits to the left and right of the decimal point to which Value is resolved.
  • scale
    The total number of decimal places to which Value is resolved.
  • sourceColumn
    The name of the source column.

Remarks

Size and Precision are inferred from the value of the dataType parameter if they are not explicitly set in the size and precision parameters.

Example

The following example creates a SqlCeParameter and displays the 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;

Platforms

Development Platforms

Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0

See Also

Reference

SqlCeParameter Class
SqlCeParameter Members
System.Data.SqlServerCe Namespace