当前位置:编程学习 > C#/ASP.NET >>

asp.net SqlDataSource的疑问

cs代码:

if (!IsPostBack)
            {

                lblCount.Text = "当前共有" + ((DataView)this.SqlDataSource1.Select(DataSourceSelectArguments.Empty)).Count.ToString() + "条记录";
            }

 

这段代码的意思是用SqlDataSource1的查询方法查询数据,最后将查询得到的数据显示在lblCount上没错吧!   但是我不明白(DataSourceSelectArguments.Empty)这个参数的意思,Empty不是空的意思吗?是表示查询语句不用参数么?(但实际上SqlDataSource上有两个参数,默认为-1)..谁能给我解释一下DataSourceSelectArguments.Empty这个的意思?! 感谢!

追问:为什么? 不允许使用sqlDataSource,使用ObjectDataSource吗?
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,