
  public partial class CommandParamrter : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          //创建连接串
          string connStr = "【server】=(local);uid=sa;【pwd】=123;database=demo";
          //创建Connection
          SqlConnection conn = new SqlConnection(connStr);
          //创建Command，SQL语句中有参数@UserName与RealName
          SqlCommand cmd = new SqlCommand(" 【insert】 into users(UserName,RealName) values(【@UserName】,@RealName)", 【conn】);
          //把@UserName参数加入到Parameters，并给参数赋值
          cmd.Parameters.Add("@UserName", SqlDbType.【VarChar】).Value = "hello";
          //把@RealName参数加入到Parameters，并给参数赋值
          cmd.Parameters.Add("@RealName", 【SqlDbType】.VarChar).Value = "张三";
          //打开连接
          conn.Open();
          //执行SQL命令
          cmd.【ExecuteNonQuery】();
          //关闭连接
          conn.Close();
      }
  
  }

--答案--
   SqlDbType   VarChar   insert   @UserName   server   ExecuteNonQuery