提交 94b2a395 编写于 作者: s0611163's avatar s0611163

Access数据库分页查询增加错误提示:Access数据库分页查询必须有order by子句

上级 4d538f37
......@@ -65,6 +65,8 @@ namespace Dapper.LiteSql
#region 创建分页SQL
public string CreatePageSql(string sql, string orderby, int pageSize, int currentPage)
{
if (string.IsNullOrWhiteSpace(orderby)) throw new Exception("Access数据库分页查询必须有order by子句");
Regex regex = new Regex("order[\\s]+by", RegexOptions.IgnoreCase);
orderby = regex.Replace(orderby, string.Empty);
string[] orderbyArray = orderby.Split(',');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册