首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

SqlDataSource取分页数据的有关问题,DataSourceSelectArguments(int,int)重载为什么出错

2011-12-25 
SqlDataSource取分页数据的问题,DataSourceSelectArguments(int,int)重载为什么出错?代码如下,就这么3行,

SqlDataSource取分页数据的问题,DataSourceSelectArguments(int,int)重载为什么出错?
代码如下,就这么3行,最简单的了

C# code
DataSourceSelectArguments dssa = new DataSourceSelectArguments(4, 3);object o = SqlDataSource1.Select(dssa);GridView1.DataSourceID = "SqlDataSource1";


运行后出错,提示信息为:
SqlDataSource“SqlDataSource1”未启用分页。将 DataSourceMode 设置为 DataSet 以启用分页。

实际上SqlDataSource本来就是默认DataSet的啊,而且即使设置了也没用
改成无参数的就正常了
C# code
DataSourceSelectArguments dssa = new DataSourceSelectArguments();

但是我希望直接获取其中某一页的记录

请教,这是什么缘故,如何解决?!?!

[解决办法]
dssa.AddSupportedCapabilities(DataSourceCapabilities.Page);

热点排行