strsql = "update (select em_house_t.* from em_house_t,em_floors_t,em_building_t where room_number ='" + id + "' and em_house_t.floor_id=em_floors_t.floor_id and em_floors_t.building_id= em_building_t.building_id and em_building_t.building_id= '" + buildingID + "')" +
                          "set  oldlandnum ='"+1+"'+'"+-+"'+'"+lot_id+"'+'"+-+"'+''"+LOT_NUMERATOR+"''"+-+"''"+oldlandnum + "'";
这条语句 ,更新oldlandnum  更新的值是用户输入的几个数字凭接的 第一个数字固定是1  第二关是lot_id,第三个是lot_numerator,第四个是oldlandnum,然后这些书中间有'-'隔开  比如说 1-2002-32-101  现在我加-的时候说    运算符“+”无法应用于“string”类型的操作数 这个转换也不好转吧``` 怎么弄呢?

解决方案 »

  1.   

    string s="set oldlandnum ='1-"+lot_id+"-"+LOT_NUMERATOR+"'";
      

  2.   

    strsql = "update (select em_house_t.* from em_house_t,em_floors_t,em_building_t where room_number ='" + id + "' and em_house_t.floor_id=em_floors_t.floor_id and em_floors_t.building_id= em_building_t.building_id and em_building_t.building_id= '" + buildingID + "')" +
      "set oldlandnum ='1-"+lot_id+"-"+LOT_NUMERATOR+"-"+oldlandnum + "'";
      

  3.   


     "set oldlandnum ='" + "1-" + lot_id + "-" + LOT_NUMERATOR + "-" + oldlandnum + "'";