private void itemDD_SelectedIndexChanged(object sender, EventArgs e) { if (itemDD.SelectedIndex != -1) { try { itemEL.Visible = false; SqlCommand cmd = new SqlCommand("st_getPriceWRTitem", MainClass.con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mid", Convert.ToInt32(itemDD.SelectedValue.ToString())); MainClass.con.Open(); priceTxt.Text = Math.Round(Convert.ToDouble(cmd.ExecuteScalar().ToString()), 0).ToString(); MainClass.con.Close(); DataRowView drv = itemDD.SelectedItem as DataRowView; RetrivalData.loadCategoryWRTItem(drv["Menu Name"].ToString()); } catch (Exception ex) { MainClass.showMessage(ex.Message, "error"); } } else { itemEL.Visible = true; priceTxt.Text = ""; } }