Partilhar via


SqlCeParameter Constructor (String, Object)

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Initializes a new instance of the SqlCeParameter class with the parameter name and the value of the new SqlCeParameter.

  [Visual Basic]
  Public Sub New( _
   ByVal 
  name
   As String, _
   ByVal value As Object _
)
[C#]
public SqlCeParameter(
   string name,object value
);
[C++]
public: SqlCeParameter(
   String* name,Object* value
);
[JScript]
public function SqlCeParameter(
   name : String,
 value : Object);

Parameters

  • name
    The name of the parameter to map.
  • value
    The value of the new SqlCeParameter object.

Exceptions

Exception Type Condition
InvalidCastException The object supplied as the value parameter cannot be converted to a string. This can happen if the object is not a primative type, SqlDbType or byte array.

Remarks

SqlDbType is not inferred from the .NET Compact Framework type of the value parameter. The Value property of the new SqlCeParameter object is set to the string obtained from converting the value parameter and the SqlDbType is set to SqlDbType.NChar.

If you want to explicly set the SqlDbType of the parameter when it is created, you should use one of the other constructors for SqlCeParameter.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeParameter Class | SqlCeParameter Members | System.Data.SqlServerCe Namespace | SqlCeParameter Constructor Overload List

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.