IDataSourceProvider 接口

定义

定义经控件设计器实现后可访问数据源的接口。Defines an interface that a control designer can implement to provide access to a data source.

public interface class IDataSourceProvider
public interface IDataSourceProvider
type IDataSourceProvider = interface
Public Interface IDataSourceProvider
派生

示例

下面的代码示例演示一个名为TemplatedListDesigner的自定义类, 该类继承TemplatedControlDesigner自类并实现IDataSourceProvider接口。The following code example shows a custom class, named TemplatedListDesigner, which inherits from the TemplatedControlDesigner class and implements the IDataSourceProvider interface.

<FileName>databounddesigner.vb</FileName>
<RelevantItems>
  <Reference>System.Web.UI.Design.ControlDesigner</Reference>
  <Reference>System.Web.UI.Design.TemplatedControlDesigner</Reference>
  <Reference>System.Web.UI.Design.IDataSourceProvider</Reference>
</RelevantItems>

注解

能够提供数据源的类可以通过使用IDataSourceProvider接口的对象实现此接口, 以启用对其数据源的访问。A class that is able to provide a data source can implement this interface to enable access to its data source by objects that use the IDataSourceProvider interface. 此接口由DataFieldConverterDataMemberConverter类使用。This interface is used by the DataFieldConverter and DataMemberConverter classes.

方法

GetResolvedSelectedDataSource()

从所选的数据源中获取选定的数据成员。Gets the selected data member from the selected data source.

GetSelectedDataSource()

获取对数据源提供程序的选定数据源的引用。Gets a reference to the selected data source from the data source provider.

适用于