public void pripass2()
{
float b = 0.5f;
float c;
ppass = Convert.ToSingle (label19.Text);
try
{
if (ppass > 0 && checkBox5.Checked == true)
{
ppass--;
label19.Text = ppass.ToString();
cmd = new MySqlCommand();
cmd.CommandText = "update emppassdetails set activepass='" + label19.Text + "'";
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
else if (ppass > 0 && checkBox5.Checked == false)
{
c = ppass - b;
label19.Text = c.ToString();
cmd = new MySqlCommand();
cmd.CommandText = "update emppassdetails set activepass='" + label19.Text + "'";
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
}
catch (Exception ex)
{
MessageBox.Show("Please Call Anurag"+ex.Message );
}
}
Here PPASS IS declared globally and other variables are local but elseif statement is giving error and if statement is working fine
Data Truncated for column activepass at row 1