跪求解决问题的答案 !!急啊 !哪位前辈指点迷津一下! using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient;
public partial class User_Create : System.Web.UI.Page { DBClass dbOcj = new DBClass(); protected void Page_Load(object sender, EventArgs e) {
} protected void CQBtn_Click(object sender, EventArgs e) { if (!IsPostBack) { SqlConnection conn = dbOcj.GetConnection(); try { conn.Open(); SqlCommand sqltext = new SqlCommand("insert into [_User] values (@Name,@Possword,@真实姓名,@性别,@地址,@联系电话)", conn); SqlCommand sqlselect = new SqlCommand("select count(*) from [_User] where Name=@Name"); sqltext.Parameters[0].Value = CNameTextBox.Text.Trim(); sqltext.Parameters[1].Value = CPosswordTextBox.Text.Trim(); sqltext.Parameters[2].Value = YournameTextBox.Text.Trim(); sqltext.Parameters[3].Value = ListBox1.SelectedValue; sqltext.Parameters[4].Value = AdressTextBox.Text.Trim(); sqltext.Parameters[5].Value = PhoneTextBox.Text.Trim(); int count = Convert.ToInt32(sqlselect.ExecuteScalar()); if (count > 0) { Response.Write("<script>alert('该用户已被注册!')</script>"); } else { if(sqltext.ExecuteNonQuery()) { Response.Write("<script>alert('注册失败!')</script>");