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
'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)

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 a null reference (Nothing in Visual Basic) parameter value to the server, the user must specify DBNull, not a null reference (Nothing in Visual Basic). The a null reference (Nothing in Visual Basic) value in the system is an empty object that has no value. DBNull is used to represent a null reference (Nothing in Visual Basic) 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";

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

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