Im stuck in this line. im new to c# and i just converted my code from vb.net to c#. after converting an unhandled error occured. i dont know what is the cause. some people say that Int32.Parse cause null exception but Convert.ToInt32 doesn't.
frmPointofSale pointofsale = new frmPointofSale();
this.btnOK.Enabled = true;
if (Convert.ToInt32(txtquantity.Text) < 1)
{
this.btnOK.Enabled = false;
}
else if (Convert.ToInt32(txtquantity.Text) > Convert.ToInt32(pointofsale.dgvList.CurrentRow.Cells[8].Value.ToString()))
{
btnOK.Enabled = false;
MessageBox.Show("not enough quantity!");
return;
}
TextBox3.Text = Convert.ToString(Convert.ToInt32(pointofsale.dgvList.CurrentRow.Cells[6].Value) * Convert.ToInt32(txtquantity.Text));
the error occurred in 'else if' statement. help me please. ty