DataSourceSelectArguments 是什么属性?

OICQshenshi 2008-05-20 10:05:21
    protected string connString = WebConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;

//Select员工数据
public DataView SelectEmployee()
{
string strCmd = "Select EmployeeID,LastName,City,Country from Employees";
SqlDataSource sqlds = new SqlDataSource(connString, strCmd);
return (DataView)sqlds.Select(DataSourceSelectArguments.Empty);

//回传DataView
}


这句MSDN中解释为:
DataSourceSelectArguments 提供一种机制,数据绑定控件可使用这种机制向数据源控件请求在检索数据之后执行与数据相关的操作。无法继承此类。
Empty 获取一个排序表达式设置为System.String.Empty的System.Web.UI.DataSourceSelectArguments对象

还是没有理解,请教下谁能用最通俗的语言来讲解下该语句是什么意思?
(DataView)sqlds.Select(DataSourceSelectArguments.Empty);
...全文
1017 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengsuyun1214 2011-03-10
  • 打赏
  • 举报
回复
不懂 DataSourceSelectArguments
pengsuyun1214 2011-03-10
  • 打赏
  • 举报
回复
DataSourceSelectArguments
htys99 2008-12-06
  • 打赏
  • 举报
回复
推下
wh110 2008-06-09
  • 打赏
  • 举报
回复
看楼上几位说的然后自己试了下,DataSourceSelectArguments的几种值是用来筛选数据
一品梅 2008-06-07
  • 打赏
  • 举报
回复
Data-bound controls use the DataSourceSelectArguments class to request that a data source control performs additional data-related operations on a result set, such as sorting the data or returning a specific subset of data. These data-related operations are enumerated by the DataSourceCapabilities enumeration. The following table indicates how the DataSourceSelectArguments class supports these data-related operations.

Capability
Related DataSourceSelectArguments properties

DataSourceCapabilities..::.Sort
SortExpression

DataSourceCapabilities..::.Page
StartRowIndex, MaximumRows

DataSourceCapabilities..::.RetrieveTotalRowCount
RetrieveTotalRowCount, TotalRowCount

也就是说DataSourceSelectArguments可以有以上几种枚举值,来筛选数据,用empty就是默认,和原始得到数据相同.
xie_yanke 2008-06-07
  • 打赏
  • 举报
回复
是添加排序条件的语句.你可以...

sqlds.Select(new DataSourceSelectArguments("[字段] desc, [字段] Asc"));


sunshine_anycall 2008-06-07
  • 打赏
  • 举报
回复
字面意思,从datasource中选取数据的参数的意思
select时where里的条件
OICQshenshi 2008-06-04
  • 打赏
  • 举报
回复
推下
OICQshenshi 2008-05-24
  • 打赏
  • 举报
回复
求详解
OICQshenshi 2008-05-23
  • 打赏
  • 举报
回复
求详解
namhyuk 2008-05-22
  • 打赏
  • 举报
回复
我也一直没搞懂。

也不用想那么多吧,只要知道SqlDataSource.Select()返回IEnumerable,可以转换为DataView。

而且Select不能没有参数,而参数也只有这一个选择:DataSourceSelectArguments.Empty。

SqlDataSource的Insert(),Update(), Delete()都没参数,只有Select有这莫名其妙的参数。搞不懂。
OICQshenshi 2008-05-21
  • 打赏
  • 举报
回复
没人知道吗?
OICQshenshi 2008-05-20
  • 打赏
  • 举报
回复
up

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧