Share via


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
    Get
    Set
'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;
}
abstract Value : Object with get, set
override Value : Object with get, set
override function get Value () : Object
override function set Value (value : Object)

Property Value

Type: System. . :: . .Object
An Object that is the value of the parameter. The default value is nullNothingnullptrunita null reference (Nothing in Visual Basic).

Implements

IDataParameter. . :: . .Value

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 Nothing nullptr unit 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.

Examples

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";

See Also

Reference

SqlCeParameter Class

SqlCeParameter Members

System.Data.SqlServerCe Namespace

SqlDbType

DbType