大家过来看下这个程序
public partial class Admin_AddClass : System.Web.UI.Page{
Db pn163 = new Db();
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection Conn = new SqlConnection(pn163.strConn);
string ClassName = TextBox1.Text.Trim();
string St = TextBox2.Text.Trim();
Conn.Open();
SqlCommand Cmd = new SqlCommand("insert into NewClass(Class,St)" + "values('" + ClassName + "','" + St + "')", Conn);
if (TextBox1.Text == "" && TextBox2.Text == "")
{
Response.Write("<script>alert('不能提交空值!');history.go(-1);</script>");
}
else
{
Cmd.ExecuteNonQuery();
Response.Redirect("./Class.Aspx");
}
Conn.Close();
}
}
帮帮我看下这个实现什么功能