插入、更新和删除后,我希望我的 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();
}
}