SqlCommand command = new SqlCommand("UPDATE qcCheckList SET reviewed = @0, errorLevel = @1, comment = @2 WHERE guid = @3 and itemId = @4", connection);
command.Parameters.AddWithValue("0", cli.reviewed.Checked);
int errorLevel = 0;
if (cli.error.Text == "Level 1")
errorLevel = 1;
else if (cli.error.Text == "Level 2")
errorLevel = 2;
else if (cli.error.Text == "Level 3")
errorLevel = 3;
command.Parameters.AddWithValue("1", errorLevel);
command.Parameters.AddWithValue("2", cli.comments.Text);
command.Parameters.AddWithValue("3", guid);
command.Parameters.AddWithValue("4", cli.itemId);
command.ExecuteNonQuery();
Console.WriteLine(command.CommandText);
When i run this code it doesn't look like my sql command's parameters are being replaced by their actual values. I want to be able to see their values when the command is compiled so i can see if the correct command is being sent. Any ideas?
@prefix when adding the parameters?it doesn't look like my sql command's parameters are being replaced by their actual values.<= What do you mean by this? Also the values do not replace the parameters, the parameters and their values are sent with the query.