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
'Usage
Dim instance As SqlCeParameter
Dim value As Object

value = instance.Value

instance.Value = value
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)
Not applicable.

Property Value

An Object that is the value of the parameter. The default value is a null reference (Nothing in Visual Basic).

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 a null reference (Nothing in Visual Basic),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";

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

SqlCeParameter Class
SqlCeParameter Members
System.Data.SqlServerCe Namespace
SqlDbType
DbType