Share via


SqlCeParameter.Value Property

Gets or sets the value of the parameter.

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

Syntax

'Declaration
Public Overrides Property Value As Object
public override Object Value { get; set; }
public:
virtual property Object^ Value {
    Object^ get () override;
    void set (Object^ value) override;
}
/** @property */
public Object get_Value ()

/** @property */
public void set_Value (Object value)
public override function get Value () : Object

public override function set Value (value : Object)

Property Value

An Object that is the value of the parameter. The default value is null.

Remarks

The value is bound to the SqlCeCommand that is sent to the server.

When sending a null parameter value to the server, the user must specify DBNull, not null,which is an empty object that has no value. DBNull is used to represent null values.

If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider attempts to convert any type of value if it supports the IConvertible interface. Conversion errors may result if the specified type is not compatible with the value.

Both the DbType and SqlDbType properties can be inferred by setting the Value.

The Value property is overwritten by Update.

Example

The following example creates a SqlCeParameter and sets the Value property.

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.

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
SqlCeParameter.SqlDbType Property
SqlCeParameter.DbType Property