Represents a collection of parameters associated with a System.Data.SqlClient.SqlCommand and their respective mappings to columns in a System.Data.DataSet. This class cannot be inherited.
See Also: SqlParameterCollection Members
If the command contains an ad hoc SQL statement, as opposed to a stored-procedure name, the number of the parameters in the collection must be equal to the number of parameter placeholders within the command text, or SQL Server raises an error. With a stored procedure, all the parameters declared in the stored procedure without a default value must be provided. Parameters declared with a default value are optional. This lets you specify a value other than the default.
For more information with additional sample code demonstrating how to use parameters, see Commands and Parameters (ADO.NET).