string ConnectionString = "Server=localhost;Integrated Security=True;Database=Northwind;User=****;password=****;";
string QueryString = "SELECT * FROM [Employees]";
System.Web.UI.WebControls.SqlDataSource SqlDataSource = new System.Web.UI.WebControls.SqlDataSource();
SqlDataSource.ConnectionString = ConnectionString;
SqlDataSource.SelectCommand = QueryString;
DataSourceSelectArguments arg = new DataSourceSelectArguments();
System.Data.DataView dv = (System.Data.DataView)SqlDataSource.Select(arg);
//这样可以得到DataView
System.Data.DataView dv = (System.Data.DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
System.Data.DataView dv = (System.Data.DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);