string commandText = "UPDATE Sales.Store SET Demographics = @demographics "
        + "WHERE CustomerID = @ID;";

解决方案 »

  1.   

    SqlCommand cmd = new SqlCommand();
    cmd.CommandText=commandText;
    cmd.Parameters.AddRange(new SqlParameter[] { new SqlParameter("@demographics", "abc"), new SqlParameter("@ID", "123") });
      

  2.   

    你是想问什么呢?
    不就是两个参数么?
    可以定义一个List<>加进去就可以了啊
      

  3.   

    用cmd.Parameters来填充这些参数。MSDN的例子中有。
      

  4.   

    CreateIdeal (CreateIdeal)
      '截至2010-11-27 18:23:32  用户结帖率0.00%当您的问题得到解答后请及时结贴.
    http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
    http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
    http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
    http://community.csdn.net/Help/HelpCenter.htm#结帖
      

  5.   

    用这个好cmd.Parameters.AddWithValue("@re", "wwwww"); 方便