Israel

Israel

  • 698
  • 1.3k
  • 217.7k

deleting and filtering

Jul 19 2013 4:37 AM

Hi!
These lines of codes work well. Its saving only! Then I would like to learn how to do two things:
1. How to delete rows?
2. How to filter a data from a TextBox?
Following the logic of my codes please (for example, Protected void Delete_Click and Protected void TxtBoxFilter_Click)
Protected void Save_Click(Object sender, EventArgs e)
{
   string strcon = "Data Source=localhost\\sqlexpress;Inital Catalog=Mfwamba;Integrated Security=True";
   SqlConnection con new SqlConnection(strcon);
SqlCommand com = new SqlCommand("save123", con);
com.CommandType = CommandType.StoreProcedure;
SqlParameter p1 = new SqlParameter("FirstName",txtfirstname.Text);
SqlParameter p2 = new SqlParameter("LastName",txtlastname.Text);
com.Parameters.Add(p1);
com.Parameters.Add(p2);
con.Open();
com.ExecteNonQuery();
labelinfo.Text = "Registered successfull.";
}
Protected void Delete_Click(Object sender, EventArgs e)
{
   // ???
}
}
Protected void TxtBoxFilter_Click(Object sender, EventArgs e)
{
   // ???
}

Answers (11)