ObjectDataSource.GetView(String) ObjectDataSource.GetView(String) ObjectDataSource.GetView(String) ObjectDataSource.GetView(String) Method

定义

检索与数据源控件关联的命名数据源视图。Retrieves the named data source view that is associated with the data source control.

protected:
 override System::Web::UI::DataSourceView ^ GetView(System::String ^ viewName);
protected override System.Web.UI.DataSourceView GetView (string viewName);
override this.GetView : string -> System.Web.UI.DataSourceView
Protected Overrides Function GetView (viewName As String) As DataSourceView

参数

viewName
String String String String

要检索的视图的名称。The name of the view to retrieve. 由于 ObjectDataSource 只支持一个视图,因此 viewName 被忽略。Because the ObjectDataSource supports only one view, viewName is ignored.

返回

ObjectDataSourceView 关联的名为 DefaultViewObjectDataSourceThe ObjectDataSourceView named DefaultView that is associated with the ObjectDataSource.

异常

指定的 viewNamenullDefaultView 以外的值。The specified viewName is null or something other than DefaultView.

注解

ObjectDataSource控件仅支持一个数据源视图。The ObjectDataSource control supports only one data source view. 与所有数据源视图对象一样, 与ObjectDataSourceView数据源控件关联的定义了其功能, 执行了从基础数据存储中检索数据所需的所有工作, 并执行排序等操作。插入、删除和更新。As with all data source view objects, the ObjectDataSourceView that is associated with the data source control defines its capabilities, performs all the work that is necessary to retrieve data from the underlying data storage, and performs operations such as sorting, inserting, deleting, and updating.

GetView方法旨在由数据绑定控件 (而不是页代码) 进行调用。The GetView method is intended to be called by data-bound controls, not by page code.

适用于

另请参阅