DataBoundControl.GetData メソッド
アセンブリ: System.Web (system.web.dll 内)
 構文
構文Dim returnValue As DataSourceView returnValue = Me.GetData
データ操作を実行するためにデータ バインド コントロールが使用する DataSourceView。DataMember プロパティが設定されている場合、特定の、名前付き DataSourceView が返されます。それ以外の場合は、既定の DataSourceView が返されます。
 例外
例外 解説
解説GetData メソッドは、GetDataSource メソッドを呼び出すことで、関連するデータ ソース コントロールから DataSourceView オブジェクトを取得します。DataSource プロパティを使用してデータ ソースを指定すると、既定の DataSourceView オブジェクトが作成されます。
 使用例
使用例GetData メソッドを呼び出して、関連するデータ ソース コントロールから DataSourceView オブジェクトを取得する方法、および Select メソッドを呼び出して、データを取得する方法を次のコード例に示します。このコード例は、DataBoundControl クラスのトピックで取り上げているコード例の一部分です。
Protected Overrides Sub PerformSelect() ' Call OnDataBinding here if bound to a data source using the ' DataSource property (instead of a DataSourceID) because the ' data-binding statement is evaluated before the call to GetData. If Not IsBoundUsingDataSourceID Then OnDataBinding(EventArgs.Empty) End If ' The GetData method retrieves the DataSourceView object from the ' IDataSource associated with the data-bound control. GetData().Select(CreateDataSourceSelectArguments(), _ AddressOf OnDataSourceViewSelectCallback) ' The PerformDataBinding method has completed. RequiresDataBinding = False MarkAsDataBound() ' Raise the DataBound event. OnDataBound(EventArgs.Empty) End Sub 'PerformSelect
protected override void PerformSelect() { // Call OnDataBinding here if bound to a data source using the // DataSource property (instead of a DataSourceID), because the // databinding statement is evaluated before the call to GetData. if (! IsBoundUsingDataSourceID) { OnDataBinding(EventArgs.Empty); } // The GetData method retrieves the DataSourceView object from // the IDataSource associated with the data-bound control. GetData().Select(CreateDataSourceSelectArguments(), OnDataSourceViewSelectCallback); // The PerformDataBinding method has completed. RequiresDataBinding = false; MarkAsDataBound(); // Raise the DataBound event. OnDataBound(EventArgs.Empty); }
 プラットフォーム
プラットフォームWindows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
 バージョン情報
バージョン情報 参照
参照- DataBoundControl.GetData メソッドのページへのリンク

 
                             
                    


