System.Data.SqlClient Namespace
Represents the collection of parameters for an SqlCommand.
Visibility |
Name |
Parameters |
Return Type |
public |
Add |
(
String
parameterName
,
SqlDbType
sqlDbType
,
Int32
size
)
|
SqlParameter
|
public |
Add |
(
String
parameterName
,
SqlDbType
sqlDbType
,
Int32
size
,
String
sourceColumn
)
|
SqlParameter
|
public |
Add |
(
Object
value
)
|
Int32
|
public |
Add |
(
String
parameterName
,
SqlDbType
sqlDbType
)
|
SqlParameter
|
public |
Add |
(
SqlParameter
value
)
|
SqlParameter
|
public |
Add |
(
String
parameterName
,
Object
value
)
|
SqlParameter
|
public |
AddRange |
(
Array
values
)
|
Void
|
public |
AddRange |
(
SqlParameter
values
)
|
Void
|
public |
AddWithValue |
(
String
parameterName
,
Object
value
)
|
SqlParameter
|
public |
Clear |
( )
|
Void
|
public |
Contains |
(
String
value
)
|
Boolean
|
public |
Contains |
(
SqlParameter
value
)
|
Boolean
|
public |
Contains |
(
Object
value
)
|
Boolean
|
public |
CopyTo |
(
Array
array
,
Int32
index
)
|
Void
|
public |
CopyTo |
(
SqlParameter
array
,
Int32
index
)
|
Void
|
public |
GetEnumerator |
( )
|
IEnumerator
|
protected |
GetParameter |
(
Int32
index
)
|
DbParameter
|
protected |
GetParameter |
(
String
parameterName
)
|
DbParameter
|
public |
IndexOf |
(
Object
value
)
|
Int32
|
public |
IndexOf |
(
SqlParameter
value
)
|
Int32
|
public |
IndexOf |
(
String
parameterName
)
|
Int32
|
public |
Insert |
(
Int32
index
,
SqlParameter
value
)
|
Void
|
public |
Insert |
(
Int32
index
,
Object
value
)
|
Void
|
public |
Remove |
(
Object
value
)
|
Void
|
public |
Remove |
(
SqlParameter
value
)
|
Void
|
public |
RemoveAt |
(
String
parameterName
)
|
Void
|
public |
RemoveAt |
(
Int32
index
)
|
Void
|
protected |
SetParameter |
(
String
parameterName
,
DbParameter
value
)
|
Void
|
protected |
SetParameter |
(
Int32
index
,
DbParameter
value
)
|
Void
|
|
The SqlParameterCollection represents the set of parameters defined for a given SqlCommand. This collection is accessed via the SqlCommand.Parameters property.
Like most data collections in ADO.NET, the SqlParameterCollection uses standard collection methods such as Add, Clear, and Remove. In addition, the Contains method can be used to check for the existence of a particular parameter in the collection.
The number of parameters in the collection must be equal to the number of parameter placeholders within the command text; otherwise, SQL Server™ raises an error.
SqlParameter SqlCommand.Parameters