if (cmbstate.SelectedValue.ToString() == null)
{
MessageBox.Show("Please select proper state", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
int id;
bool paresOK = Int32.TryParse(cmbstate.SelectedValue.ToString(), out id);
SqlDataAdapter cityda = new SqlDataAdapter("select * from city where state_id = '" + id + "' ", con);
DataTable citydt = new DataTable();
cityda.Fill(citydt);
cmbcity.Text = "-Select-";
cmbcity.DataSource = citydt;
cmbcity.DisplayMember = "city_name";
cmbcity.ValueMember = "city_id";
}