日期:2014-05-17  浏览次数:20396 次

请帮我看看这段代码
Asp.net的web里面,我设计了一个注册功能,想把数据填入数据库,然后总是提示我失败
protected void btn_Register_Click(object sender, EventArgs e)
  {
  String Md5_User_Pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_User_Pwd.Text, "MD5");
  DB db = new DB();
  String SqlStr = "insert into 会员表(用户名,密码,姓名,性别,出生日期,联系地址,联系电话,手机,邮政编码,身份证号)"
  + "Values('" + this.txt_User_Name.Text + "','" + this.txt_User_Pwd.Text + "','" + this.txt_Rel_Name.Text + "',"
  + "'" + this.DDL_Sex.SelectedItem.Text + "','" + this.DDL_Year.SelectedItem.Text + "','" + this.DDL_Month.SelectedItem.Text + "',"
  + "'" + this.DDL_Day.SelectedItem.Text + "','" + this.txt_Address.Text + "','" + this.txt_Tel.Text + "',"
  + "'" + this.txt_Mobile.Text + "','" + this.txt_Postcode.Text + "','" + this.txt_ID_Card.Text + "')";
  Boolean InsertResult;
  InsertResult = db.UpdateDataBySql(SqlStr);
  if (InsertResult == true)
  {
  this.Labinfo.Text = "恭喜您注册成功!";
  }
  else
  {
  this.Labinfo.Text = "对不起,注册失败,请重试!";
  this.txt_User_Name.Focus();
  }
  }

数据库有,表也有,总是提示我对不起,注册失败

------解决方案--------------------
好象是会员表里十个字段结果插了十二个值
其他没发现了]