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.
}
}

Pankaj Kumar ChoudharyPosted Mar 28, 2015, 5:44 AM
object Obj;
EventArgs Se;
private void button1_Click(object sender, EventArgs e)
{
Form2_Load(Obj, Se); // Here you can call your page load
}
public void Form2_Load(object sender, EventArgs e)
{
// Put your code
}
SenzeyePosted Mar 28, 2015, 4:28 AM
Create new class
protected void delete()
{
//Give to Your Delete Code
}
Delete Button Inside Call Class Name
private void button4_Click(object sender, EventArgs e)
{
delete();
}
Refer Below LINK
http://dotnetdrizzles.blogspot.in/2015/03/sorting-gridview-selected-dropdownlist.html