-1
插入,更新和刪除後我想我的TEXT.BOX空......所以我該怎麼做...... ????關於text.box空
protected void Button4_Click(object sender, EventArgs e) //delete
{
if (TexBo_num.Text == "")
{
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('contact_no is coumpulsary');", true);
}
else
{
SqlConnection con = new SqlConnection(@"Data Source=SYSTEM2\SQLEXPRESS;Initial Catalog=amresh;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("delete from detail where contact_no=" + TexBo_num.Text, con);
cmd.ExecuteNonQuery();
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('record deleted')", true);
con.Close();
}
}