Share via


Add Method (String, SqlDbType, Int32, String)

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

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, _
    sourceColumn As String _
) As SqlCeParameter
'Usage
Dim instance As SqlCeParameterCollection
Dim parameterName As String
Dim type As SqlDbType
Dim size As Integer
Dim sourceColumn As String
Dim returnValue As SqlCeParameter

returnValue = instance.Add(parameterName, _
    type, size, sourceColumn)
public SqlCeParameter Add(
    string parameterName,
    SqlDbType type,
    int size,
    string sourceColumn
)
public:
SqlCeParameter^ Add(
    String^ parameterName, 
    SqlDbType type, 
    int size, 
    String^ sourceColumn
)
member Add : 
        parameterName:string * 
        type:SqlDbType * 
        size:int * 
        sourceColumn:string -> SqlCeParameter 
public function Add(
    parameterName : String, 
    type : SqlDbType, 
    size : int, 
    sourceColumn : String
) : 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, "Description")
SqlCeParameter p1 = cmd.Parameters.Add("@Description", SqlDbType.NVarChar, 16, "Description");

See Also

Reference

SqlCeParameterCollection Class

SqlCeParameterCollection Members

Add Overload

System.Data.SqlServerCe Namespace