"UPDATE table SET ProAuditing=@ProAuditing Where ProId In ("+@ProId+")"

解决方案 »

  1.   

    MyComm.Parameters.Add(new SqlParameter("@ProId", SqlDbType.Int, 4));
    MyComm.Parameters["@ProId"].Value = Int32.Parse(this._P_ProId);这下面应该怎么写呢??
      

  2.   

    SqlCommand MyComm = new SqlCommand("UPDATE table SET ProAuditing=@ProAuditing Where ProId In (1,2,3,4)",MyStrConn);
    应该就可以吧
      

  3.   

    ProId是table表中的列吧,
    SqlCommand MyComm = new SqlCommand("UPDATE table SET ProAuditing=@ProAuditing Where ProId In (@ProId1,@ProId2,@ProId3,@ProId4)", MyStrConn);
    我想你是不是应该设置4个参数啊,因为这些是可变的
      

  4.   


    SqlCommand MyComm = new SqlCommand("UPDATE table SET ProAuditing='"+@ProAuditing+"' Where ProId In ("+@ProId+")", MyStrConn);
    MyComm.ExecuteNonQuery();
    MyStrConn.Close();