1
我正在測試SubSonic,但我堅持我的第一個簡單例子。我有我試圖獲取10個最新的結果的消息表:簡單亞音速例子的sql錯誤
var newsItems = News.GetPaged("datecreated", 0, 10);
這導致了這個錯誤:
[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 6]
生成的SQL:
SELECT `newsid`, `datecreated`, `headline`, `body`, `link`, `picture`, `linkinfo`, `postedby`, `comments`, `category` FROM news ORDER BY newsid DESC LIMIT -10,10
這很容易手動修復SQL,但我不知道如何讓SubSonic自動爲查詢添加正確的LIMIT。任何指針?
謝謝!我以爲pageIndex是零.. – Vidar 2011-01-31 21:02:38