DataSourceControl.IDataSource.GetView(String) 方法

定义

获取与 DataSourceControl 控件关联的指定 DataSourceView 对象。Gets the named DataSourceView object associated with the DataSourceControl control. 有些数据源控件只支持一个视图,有些则支持多个视图。Some data source controls support only one view, while others support more than one.

 virtual System::Web::UI::DataSourceView ^ System.Web.UI.IDataSource.GetView(System::String ^ viewName) = System::Web::UI::IDataSource::GetView;
System.Web.UI.DataSourceView IDataSource.GetView (string viewName);
abstract member System.Web.UI.IDataSource.GetView : string -> System.Web.UI.DataSourceView
override this.System.Web.UI.IDataSource.GetView : string -> System.Web.UI.DataSourceView
Function GetView (viewName As String) As DataSourceView Implements IDataSource.GetView

参数

viewName
String

要检索的 DataSourceView 的名称。The name of the DataSourceView to retrieve. 在只支持一个视图的数据源控件(如 SqlDataSource)中,此参数会被忽略。In data source controls that support only one view, such as SqlDataSource, this parameter is ignored.

返回

DataSourceView

返回与 DataSourceControl 关联的指定 DataSourceViewReturns the named DataSourceView associated with the DataSourceControl.

实现

例外

viewNamenullviewName is null.

注解

viewName 仅支持一个视图的数据源控件(如和控件)上调用此方法时,将忽略 SqlDataSource 参数 AccessDataSourceThe viewName parameter is ignored when this method is called on data source controls that support only one view, such as the SqlDataSource and AccessDataSource controls.

备注

DataSourceControl此接口方法调用的类的默认实现返回 nullThe DataSourceControl class's default implementation, which is called by this interface method, returns null. 如果扩展 DataSourceControl 类,请重写 GetView 方法以返回指定的 DataSourceView 对象。If you extend the DataSourceControl class, override the GetView method to return the specified DataSourceView object.

适用于

另请参阅