Durga Velusamy

Durga Velusamy

  • NA
  • 318
  • 114.1k

refrsh pge after deleted item needto don't show in combolist

Mar 28 2015 3:19 AM

 please give sample code to refresh a page after delete item its need to do not show in the combolist

 private void button4_Click(object sender, EventArgs e)

        {

            SqlConnection con = new SqlConnection(@"server=CSE-PC; integrated security=true; Database=Bas");

            con.Open();

 

            if ((comboBox1.Text == "") && (comboBox2.Text == "") && (comboBox3.Text == "") && (comboBox4.Text == "") && (comboBox5.Text == "") && (comboBox6.Text == "") && (comboBox7.Text == ""))

            {

                MessageBox.Show("doesn't delete null value");

            }

            else

            {

 

                SqlCommand cmd = new SqlCommand("Delete from devi where CustomerId='" + comboBox1.Text + "'", con);

                cmd.ExecuteNonQuery();

                MessageBox.Show("Deleted Successfully");

                comboBox1.Text = "";

                comboBox2.Text = "";

                comboBox3.Text = "";

                comboBox4.Text = "";

                comboBox5.Text = "";

                comboBox6.Text = "";

                comboBox7.Text = "";

                con.Close();

 

 

here I need to refresh a page after delete item its need to do not show in the combolist .

 

my problem is : after deleted the item it shows in the combolist. But the item is deleted from the database even the item name only displacing in the combolist I need to update with current satus.

 

            }

        }

 


Answers (2)