LinqDataSource - Can you limit the amount of records returned?

后端 未结 6 1399
抹茶落季
抹茶落季 2021-01-01 09:14

I\'d like to use a LinqDataSource control on a page and limit the amount of records returned. I know if I use code behind I could do something like this:

6条回答
  •  不思量自难忘°
    2021-01-01 09:51

    I know that if you use a paging repeater or gridview with the linqdatasource it will automatically optimize the number of results returned, but I'm also pretty sure in the datasource wizard you can go to advanced options and limit it to

    SELECT TOP 3 FROM 
    

    which should allow you to do what you need

提交回复
热议问题