
  public partial class Register : System.Web.UI.Page
  {
      //单击提交按钮 
      protected void btnSubmit_Click(object sender, System.EventArgs e)
      {
          if (Page.IsValid)     
          {
              string userName = txtName.Text.Trim();
              //判断输入的用户名是否存在
              string sql = "select count(*) from Users where UserName='" + userName + "'";
              int n = DBHelper.【execScalar】(sql);
              if (n > 0)
              {
                  Response.【Write】("<script>【alert】(\"提示：用户名已存在！\")</script>");
                  return;
              }
  
              //构建加入注册记录的SQL语句
              sql = "【INSERT】 INTO " +
                    "Users(UserName,RealName,Sex,[Password],Question,Answer,Email)" +
                    " values(@UserName,@RealName,@Sex,@Password,@Question,@Answer,@Email)";
  
              Hashtable ht = new 【Hashtable】();               
              ht.Add("UserName", userName);
              ht.Add("realname", txtRealName.Text.Trim());
              ht.【Add】("sex", lstSex.SelectedItem.Text.Trim());
              ht.Add("Password", txtPwd1.Text.Trim());
              ht.Add("question",  lstQuestion.【SelectedItem】.Text);
              ht.Add("answer",txtAnswer.Text.Trim());
              ht.Add("email", txtEmail.Text.Trim());
              DBHelper.execSql(【sql】, ht);
  
              Session["UserName"] = userName;
              Response.【Redirect】("Default.aspx");
          }
  
      }
  }

--答案--
   execScalar   alert   Write   SelectedItem   INSERT   Hashtable   Redirect