0
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();
}
}
錯誤:必須爲@Model聲明標量變量。 我應該刪除/添加那裏?無法弄清楚。 在此先感謝。標量變量未聲明