以下是引用片段:
其相关代码如下: private void LinkButton2_Click(object sender, System.EventArgs e) { //判断注册信息是否正确 if (this.TextBox1.Text.Trim()=="" || this.Textbox9.Text.Trim()=="") { this.TErr.InnerHtml="客户或身份证号为空!"; return; } if(this.Textbox5.Text.Trim()!=this.Textbox6.Text.Trim() ) { this.TErr.InnerHtml="密码不一致!"; return; }
DataTable tmpda=new DataTable(); tmpda=Sql2000DB.Get_Table("select * from KHXX where kh='"+ this.TextBox1.Text.Trim() +"'"); if(tmpda.Rows.Count>0 ) { this.TErr.InnerHtml="此帐户已经存在,请重新输入!"; return; } //添加注册的用户信息到数据库中 Sql2000DB.ExecSql("insert into KHXX(Kh,Mm,Lxdz,dh,Sr,Email,IDCount,Sfzh) values('"+ this.TextBox1.Text.Trim() +"','"+ this.Textbox5.Text.Trim() +"','"+ this.Textbox2.Text.Trim() +"','"+ this.TextBox4.Text.Trim() +"','"+ this.TextBox3.Text.Trim() +"','"+ this.Textbox7.Text.Trim() +"','"+ this.Textbox8.Text +"','"+ this.Textbox9.Text +"')"); Session["UserID"]=this.TextBox1.Text.Trim(); Response.Redirect("index0.aspx"); }
|