【发布时间】:2018-11-26 15:59:33
【问题描述】:
我是使用这个库 SqlKata 的初学者,我很难理解 Paginate 方法的功能。
使用 Get 方法,我可以访问 SQL 记录。但是使用 Paginate 我不能。 Paginate 方法会给我带来数据库的记录吗?
dim db = new QueryFactory(new SqlConnection("[connection-string]"), new SqlServerCompiler())
dim library = db.Query("my_table").Select("*").Paginate(1, 10)
for each book in library.each
response.write(book.id)
next
这会引发错误:
未找到类型“PaginationResult(Of Object)”上的公共成员“id”。
系统信息:
SqlKata 1.1.3
Microsoft .NET 框架版本:4.0.30319; ASP.NET 版本:4.7.3163.0
VB.NET
【问题讨论】:
-
What is the content of query
my_table,id可能未在您的查询中选择。 -
@Aria 我选择了所有列,正如您在
db.Query("my_table").Select("*")中看到的那样。如果我使用 `db.Query("my_table").Get() 我可以得到 id。我认为这不是 Query 的问题,而是如何处理这个 PaginationResult 的问题。