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?
Asked
Active
Viewed 1,691 times
1 Answers
4
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.

David Elizondo
- 1,123
- 1
- 7
- 16
-
1I just wanted to add that you can add a diagnostic switch to your app.config or web.config to see in the output window the generated sql. Here is a Sql 2008 example -