diff --git a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index 51f81136e..401570324 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -844,7 +844,14 @@ namespace SqlSugar } else { - dt=this.Context.Queryable().WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable(); + if (this.UpdateObjs.ToList().Count == 0) + { + dt = new DataTable(); + } + else + { + dt = this.Context.Queryable().WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable(); + } } if (dt.Rows != null && dt.Rows.Count > 0) {