Aracılığıyla paylaş


SqlCeParameter Class

Represents a parameter to a SqlCeCommand and, optionally, its mapping to a DataSet column. This class cannot be inherited.

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    System.Data.Common.DbParameter
      System.Data.SqlServerCe.SqlCeParameter

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

Syntax

'Declaration
Public NotInheritable Class SqlCeParameter _
    Inherits DbParameter _
    Implements ICloneable
'Usage
Dim instance As SqlCeParameter
public sealed class SqlCeParameter : DbParameter, 
    ICloneable
public ref class SqlCeParameter sealed : public DbParameter, 
    ICloneable
[<SealedAttribute>]
type SqlCeParameter =  
    class
        inherit DbParameter
        interface ICloneable
    end
public final class SqlCeParameter extends DbParameter implements ICloneable

The SqlCeParameter type exposes the following members.

Constructors

  Name Description
Public method SqlCeParameter() Initializes a new instance of the SqlCeParameter class.
Public method SqlCeParameter(String, SqlDbType) Initializes a new instance of the SqlCeParameter class with the parameter name and data type.
Public method SqlCeParameter(String, Object) Initializes a new instance of the SqlCeParameter class with the parameter name and the value of the new SqlCeParameter.
Public method SqlCeParameter(String, SqlDbType, Int32) Initializes a new instance of the SqlCeParameter class with the parameter name, data type, and length.
Public method SqlCeParameter(String, SqlDbType, Int32, String) Initializes a new instance of the SqlCeParameter class with the parameter name, data type, length, and source column name.
Public method SqlCeParameter(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 supports only input parameters.
Public method SqlCeParameter(String, SqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) Initializes a new instance of the SqlCeParameter class with the parameter name, data type, length, parameter direction, and other properties. SQL Server Compact only supports input parameters.

Top

Properties

  Name Description
Public property DbType Gets or sets the DbType of the parameter. (Overrides DbParameter.DbType.)
Public property Direction This property always returns ParameterDirection.Input for .NET Compact Framework Data Provider for SQL Server Compact. Setting this property to a different value causes an InvalidOperationException to be thrown. (Overrides DbParameter.Direction.)
Public property IsNullable Gets or sets a value indicating whether or not the parameter accepts null values. (Overrides DbParameter.IsNullable.)
Public property Offset Infrastructure.
Public property ParameterName Gets or sets the name of the SqlCeParameter. (Overrides DbParameter.ParameterName.)
Public property Precision Gets or sets the maximum number of digits used to represent the Value property.
Public property Scale Gets or sets the number of decimal places to which Value is resolved.
Public property Size Gets or sets the maximum length of the data within the column. (Overrides DbParameter.Size.)
Public property SourceColumn Gets or sets the name of the source column mapped to the DataSet and used for loading or returning the Value. (Overrides DbParameter.SourceColumn.)
Public property SourceColumnNullMapping Infrastructure. (Overrides DbParameter.SourceColumnNullMapping.)
Public property SourceVersion Gets or sets the DataRowVersion to use when loading Value. (Overrides DbParameter.SourceVersion.)
Public property SqlDbType Gets or sets the SqlDbType of the parameter.
Public property Value Gets or sets the value of the parameter. (Overrides DbParameter.Value.)

Top

Methods

  Name Description
Public method CreateObjRef (inherited from MarshalByRefObject)
Public method Equals (inherited from Object)
Protected method Finalize (inherited from Object)
Public method GetHashCode (inherited from Object)
Public method GetLifetimeService (inherited from MarshalByRefObject)
Public method GetType (inherited from Object)
Public method InitializeLifetimeService (inherited from MarshalByRefObject)
Protected method MemberwiseClone() (inherited from Object)
Protected method MemberwiseClone(Boolean) (inherited from MarshalByRefObject)
Public method ResetDbType Resets the type associated with this SqlCeParameter. (Overrides DbParameter.ResetDbType().)
Public method ToString Gets a string containing the ParameterName. (Overrides Object.ToString().)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ICloneable.Clone
Explicit interface implemetationPrivate property IDbDataParameter.Precision (inherited from DbParameter)
Explicit interface implemetationPrivate property IDbDataParameter.Scale (inherited from DbParameter)

Top

Remarks

Parameter names are not case-sensitive.

Examples

The following example shows a typical use of SqlCeParameter.

Dim param As New SqlCeParameter("@Description", SqlDbType.NVarChar)
param.Value = "garden hose"
SqlCeParameter param = new SqlCeParameter("@Description", SqlDbType.NVarChar);
param.Value = "garden hose";

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Data.SqlServerCe Namespace