Share via


SqlCeParameterCollection.Add Method (SqlCeParameter)

Adds the specified SqlCeParameter to the SqlCeParameterCollection.

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

Syntax

'Declaration
Public Function Add ( _
    value As SqlCeParameter _
) As SqlCeParameter
'Usage
Dim instance As SqlCeParameterCollection
Dim value As SqlCeParameter
Dim returnValue As SqlCeParameter

returnValue = instance.Add(value)
public SqlCeParameter Add(
    SqlCeParameter value
)
public:
SqlCeParameter^ Add(
    SqlCeParameter^ value
)
member Add : 
        value:SqlCeParameter -> SqlCeParameter 
public function Add(
    value : SqlCeParameter
) : SqlCeParameter

Parameters

Return Value

Type: System.Data.SqlServerCe.SqlCeParameter
A reference to the new SqlCeParameter object.

Examples

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

Dim p1 As New SqlCeParameter("@Description", SqlDbType.NVarChar, 16)
p1.Value = "Beverages"
cmd.Parameters.Add(p1)
SqlCeParameter p1 = new SqlCeParameter("@Description", SqlDbType.NVarChar, 16);
p1.Value = "Beverages";
cmd.Parameters.Add(p1);

See Also

Reference

SqlCeParameterCollection Class

Add Overload

System.Data.SqlServerCe Namespace