我试着做
var sql = String.Format("if ( {0} > (select sStrength from yCell where Cell_ID = '{1}')) begin UPDATE yCell SET sStrength = {0} WHERE Cell_ID = '{1}' end", inMaxStrength, inCellID);
SqlCeCommand myCommand = new SqlCeCommand(sql,connection);
myCommand.ExecuteNonQuery();
有一个错误:令牌行号= 1,令牌行偏移量= 1,错误中的令牌= if 但是在sql studio中它运行正常。