private void textBox5_TextChanged(object sender, EventArgs e)
{
objConn1.Open();
int nQty = 0;
int nActualQty = Convert.ToInt32(textBox5.Text.ToString());
string sql3 = "select qty from dbo.RateMouldQuantity where ratechart= '" + comboBox5.SelectedValue.ToString() + "'";
SqlCommand com = new SqlCommand(sql3, objConn1);
SqlDataReader objQty = com.ExecuteReader();
if (objQty.Read())
{
nQty = Convert.ToInt32(objQty["Qty"]);
}
if (nQty < nActualQty)
{
MessageBox.Show("Qty is greater");
}
objConn1.Close();
}