SqlParameterCollection Class
Collects all parameters relevant to a
SqlCommand as well as their respective mappings to
System.Data.DataSet columns.
The following example adds instance of
SqlParameter to collection.
|
|---|
public void AddSqlParameters()
{
// Create sqlConnection and sqlCommand.
sqlCommand.CommandText = "DELETE Test.Dept WHERE DeptNo = :DeptNo";
sqlCommand.Parameters.Add("DeptNo", SqlType.Int).Value = 50;
sqlCommand.ExecuteNonQuery();
} |
|
|---|
Public Sub AddSqlParameters()
// Create sqlConnection and sqlCommand.
sqlCommand.CommandText = "DELETE Test.Dept WHERE DeptNo = :DeptNo"
sqlCommand.Parameters.Add("DeptNo", SqlType.Int).Value = 50
sqlCommand.ExecuteNonQuery()
End Sub 'AddSqlParameters |