DataSourceControl.IDataSource.GetView(String) DataSourceControl.IDataSource.GetView(String) DataSourceControl.IDataSource.GetView(String) Method

定义

获取与 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);
Function GetView (viewName As String) As DataSourceView Implements IDataSource.GetView

参数

viewName
String String 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.

返回

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

实现

异常

viewNamenullviewName is null.

注解

在仅支持一个视图的数据源控件 (如SqlDataSourceAccessDataSource控件) 上调用此方法时, 将忽略参数。viewNameThe 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.

备注

此接口方法调用的null类的默认实现返回。DataSourceControlThe 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.

适用于

另请参阅