Export (0) Print
Expand All

SqlCeParameter.Value Property

Gets or sets the value of the parameter.

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

public override Object Value { get; set; }

Property Value

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

Implements

IDataParameter.Value

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.

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

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


Show:
© 2014 Microsoft