protected void DropDownList8_SelectedIndexChanged(object sender, EventArgs e)
{
var connectionString = (ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
var updateCmd = "UPDATE [CarTab] SET Rent= 1 WHERE ([Model] = @Model)";
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(updateCmd, connection);
command.Connection.Open();
command.ExecuteNonQuery();
}
}
Error : Must declare scalar variable for @Model.
What should I remove/add there? Can’t figure it out.
Thanks in advance.
You can try with
You complete code