SqlCeParameterCollection.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
)
public SqlCeParameter Add (
String parameterName,
SqlDbType type,
int size,
String sourceColumn
)
public function Add (
parameterName : String,
type : SqlDbType,
size : int,
sourceColumn : String
) : SqlCeParameter
Parameters
- parameterName
The name of the parameter.
- type
One of the SqlDbType values.
- size
The width of the column.
- sourceColumn
The name of the source column.
Return Value
A reference to the new SqlCeParameter object.
Example
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");
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .
Platforms
Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Version Information
.NET Compact Framework
Supported in: 2.0, 1.0
See Also
Reference
SqlCeParameterCollection Class
SqlCeParameterCollection Members
System.Data.SqlServerCe Namespace