导航插入,提示参数过多,请问有何建议。 返回

SqlSugar 沟通中
6 402

如题。怎么才能保稳定运行。

热忱回答6

  • fate sta fate sta VIP0
    1个月前

    升级最新,我记得处理过了。

    0 回复
  • fate sta fate sta VIP0
    1个月前
    db.Utilities.PageEach(allList, 100 ,pageList=> {
      //pageList每次只有100条
    });

    如果导航对象太大 可以使用分页

    0 回复
  • 朽木 朽木 VIP0
    1个月前

    用的最新稳定版5.1.4.210。

    用了分页,每次1000条。

    配置的英文提示:

    The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.


    0 回复
  • fate sta fate sta VIP0
    1个月前

    改成20。这个错是参数化超过2100报的错。。理论上批量都不走参数化,可能你有特殊类型导致了参数化数量过多。

    0 回复
  • 朽木 朽木 VIP0
    1个月前

    @fate sta:想起来我最近改了一个实体类的一个属性,原先是string类型的,后面改成了枚举类型,

    [Alias("特定业务类型")]

    [SugarColumn(ColumnName = "BizType", ColumnDataType = "nvarchar(20)", IsNullable = true, SqlParameterDbType = typeof(EnumToStringConvert))]

    public BizType? BizType { get; set; }

    跟这个有关吗。

    0 回复
  • fate sta fate sta VIP0
    1个月前

    @朽木:是的这个会走参数化写入。 加pagesize保证一次参数化数量不要超过2100就行了。   pageszie=20这样保险

    0 回复