Export (0) Print
Expand All

SqlCeParameterCollection.Add Method (Object)

Adds a SqlCeParameter object to the SqlCeCommand.

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

public override int Add(
	Object value
)

Parameters

value
Type: System.Object
The SqlCeParameter object to add to the collection.

Return Value

Type: System.Int32
The index of the new SqlCeParameter object in the collection.

Implements

IList.Add(Object)

ExceptionCondition
InvalidCastException

The parameter passed was not a SqlCeParameter.

The following example adds a SqlCeParameter object to a SqlCeParameterCollection. It assumes that a SqlCeCommand has already been created.

int pIndex = cmd.Parameters.Add((Object)new SqlCeParameter("Description", "Beverages"));


Show:
© 2014 Microsoft