llblgen Pro SELECT TOP (n) equivalent query

安稳与你 提交于 2019-12-13 05:38:31

问题


Is it possible to perform a select top (n) query in llblgen pro?...not LINQ. If so, how can I achieve that using the SelfServicing?


回答1:


Just use the GelMulti overloads that accepts the maxItemsToReturn parameter:

int itemsToReturn = 10;    
OrderCollection orders = new OrderCollection();
orders.GetMulti(null, itemsToReturn);

This is the generated SQL:

SELECT TOP(@p2) [Northwind].[dbo].[Orders].[CustomerID] AS [CustomerId], ... 
FROM [Northwind].[dbo].[Orders]  
Parameter: @p2 : Int64. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 10.


来源:https://stackoverflow.com/questions/6837187/llblgen-pro-select-top-n-equivalent-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!