Export (0) Print
Expand All

SqlCeParameterCollection.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)

public SqlCeParameter Add(
	string parameterName,
	SqlDbType type,
	int size
)

Parameters

parameterName
Type: System.String
The name of the parameter.
type
Type: System.Data.SqlDbType
One of the SqlDbType values.
size
Type: System.Int32
The width of the column.

Return Value

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

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

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


Show:
© 2014 Microsoft