I am getting the above error for the below block of coding. I have tried several articles in this page for similar error. Still could not find a solution. Please help.
private void txtDiscount_TextChanged(object sender, EventArgs e)
{
// Calculate Discount and Final Fee
double FinalFee;
double CourseFee1;
double Disc;
CourseFee1 = Convert.ToDouble(lblCourseFee.Text);
Disc = Convert.ToDouble(txtDiscount.Text);
FinalFee = CourseFee1 - (CourseFee1 * (Disc / 100));
//MessageBox.Show(CourseFee1 + " " + Disc + " " + FinalFee.ToString("N2"));
if (Disc > 40)
{
string message = "Maximum Discount is 40% ";
string title = "Discount Maximum Limit Exceeded";
MessageBoxButtons buttons = MessageBoxButtons.OK;
DialogResult result = MessageBox.Show(message, title, buttons, MessageBoxIcon.Warning);
}
else
{
lblFinalFee.Text = FinalFee.ToString("N2");
}
}