提交订单部分
private void Button1_Click(object sender, System.EventArgs e) { SqlConnection myConn=DBCONN.CreateCon(); myConn.Open(); string uname =Session["UserName"].ToString(); string ucompanyname = Request.Form["companyname"].ToString(); string utruename = Request.Form["truename"].ToString(); string ushenfen = Request.Form["shenfen"].ToString(); string utel = Request.Form["tel"].ToString(); string uproducts = Request.Form["products"].ToString(); string utotle = Request.Form["totle"].ToString(); string uprice = Request.Form["price"].ToString();
string SqlStr="insert into user01 (companyname,truename,shenfen,tel,products,totle,price) values " +"('"+ucompanyname+"','"+utruename+"','"+ushenfen+"','"+utel+"','"+uproducts+"','"+utotle+"','"+uprice+"')"; SqlCommand SqlCmd=new SqlCommand(SqlStr,myConn); SqlCmd.ExecuteNonQuery(); Response.Write("<script>alert('你的资料已提交,点击将到首页.谢谢!');location.href='Index.aspx'</script>"); myConn.Close();
} |