SqlDataSourceView.Select(DataSourceSelectArguments) 方法

定義

使用 SelectCommand SQL 字串和 SelectParameters 集合中的任何參數,從基礎資料庫擷取資料。

public:
 System::Collections::IEnumerable ^ Select(System::Web::UI::DataSourceSelectArguments ^ arguments);
public System.Collections.IEnumerable Select (System.Web.UI.DataSourceSelectArguments arguments);
override this.Select : System.Web.UI.DataSourceSelectArguments -> System.Collections.IEnumerable
Public Function Select (arguments As DataSourceSelectArguments) As IEnumerable

參數

arguments
DataSourceSelectArguments

DataSourceSelectArguments,用於針對資料要求基本資料擷取以外的作業。

傳回

資料列的 IEnumerable 清單。

例外狀況

傳遞給 Select(DataSourceSelectArguments) 方法的 selectArgs 指定資料來源應在擷取資料時執行一些額外工作,以透過擷取的資料啟用分頁或排序,但是資料來源控制項不支援所要求的功能。

SqlDataSource 不能以基礎資料來源建立連接。

備註

方法會 Select 呼叫 ExecuteSelect 方法,並傳遞 selectArgs 參數。

如果 DataSourceMode 屬性 ExecuteSelect 設定為 DataSet 值,則方法會傳回 DataView 物件,如果 DataSourceMode 屬性設定為 DataReader 值,則傳回 IDataReader 物件。 當您完成讀取資料時, IDataReader 請關閉 物件。

適用於

另請參閱