C
Chuck D
Folks,
Can I update the value of a paramater used by a command AFTER adding the
paramater to the command, and then update it to a new value?
I want to loop through a set of values, and call a SP several times varying
one of the paramaters each time. I had hoped to do something like this bit
of psudocode;
SqlCommand myCommand = new SqlCommand("SPname", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parameterProductID = new SqlParameter("@ProductID",
SqlDbType.Int, 4);
myCommand.Parameters.Add(parameterProductID);
myConnection.Open();
while (varying <n>)
{
parameterProductID.Value = productID(n);
myCommand.ExecuteNonQuery();
}
myConnection.Close()
Does this look kosher?
Chuck
Can I update the value of a paramater used by a command AFTER adding the
paramater to the command, and then update it to a new value?
I want to loop through a set of values, and call a SP several times varying
one of the paramaters each time. I had hoped to do something like this bit
of psudocode;
SqlCommand myCommand = new SqlCommand("SPname", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parameterProductID = new SqlParameter("@ProductID",
SqlDbType.Int, 4);
myCommand.Parameters.Add(parameterProductID);
myConnection.Open();
while (varying <n>)
{
parameterProductID.Value = productID(n);
myCommand.ExecuteNonQuery();
}
myConnection.Close()
Does this look kosher?
Chuck