Share via


Add Method (String, SqlDbType, Int32)

Adds a SqlCeParameter to the SqlCeParameterCollection given the parameter name, data type, and column width.

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

Syntax

'Declaration
Public Function Add ( _
    parameterName As String, _
    type As SqlDbType, _
    size As Integer _
) As SqlCeParameter
'Usage
Dim instance As SqlCeParameterCollection
Dim parameterName As String
Dim type As SqlDbType
Dim size As Integer
Dim returnValue As SqlCeParameter

returnValue = instance.Add(parameterName, _
    type, size)
public SqlCeParameter Add(
    string parameterName,
    SqlDbType type,
    int size
)
public:
SqlCeParameter^ Add(
    String^ parameterName, 
    SqlDbType type, 
    int size
)
member Add : 
        parameterName:string * 
        type:SqlDbType * 
        size:int -> SqlCeParameter 
public function Add(
    parameterName : String, 
    type : SqlDbType, 
    size : int
) : SqlCeParameter

Parameters

Return Value

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

Examples

The following example adds new element to a SqlCeParameterCollection and returns a reference to the new SqlCeParameter.

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

See Also

Reference

SqlCeParameterCollection Class

SqlCeParameterCollection Members

Add Overload

System.Data.SqlServerCe Namespace