SqlDataSourceView.Select(DataSourceSelectArguments) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用 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 請關閉 物件。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應