diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 85f6b8840..54c8c5f1f 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -236,10 +236,10 @@ namespace SqlSugar var rowNumberString = string.Format(",ROW_NUMBER() OVER({0}) AS RowIndex ", GetOrderByString); string groupByValue = GetGroupByString + HavingInfos; string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null; - if (this.IsCount) { orderByValue = null; this.OrderByValue = oldOrderBy; } + if (this.IsCount) { orderByValue = null; } sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue); sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null); - if (this.IsCount) { return sql.ToString(); } + if (this.IsCount) { this.OrderByValue = oldOrderBy; return sql.ToString(); } var result = ToPageSql(sql.ToString(), this.Take, this.Skip); if (ExternalPageIndex > 0) { diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/DbBind/SqliteDbBind.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/DbBind/SqliteDbBind.cs index 97d7a46e6..33f401be4 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/DbBind/SqliteDbBind.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/DbBind/SqliteDbBind.cs @@ -42,6 +42,7 @@ namespace SqlSugar new KeyValuePair("nvarchar2",CSharpDataType.@string), new KeyValuePair("text",CSharpDataType.@string), new KeyValuePair("char",CSharpDataType.@string), + new KeyValuePair("nchar",CSharpDataType.@string), new KeyValuePair("num",CSharpDataType.@string), new KeyValuePair("tinyint",CSharpDataType.@byte),