IDataSourceProvider.GetSelectedDataSource Método

Definição

Obtém uma referência à fonte de dados selecionada do provedor de fonte de dados.Gets a reference to the selected data source from the data source provider.

public:
 System::Object ^ GetSelectedDataSource();
public object GetSelectedDataSource ();
abstract member GetSelectedDataSource : unit -> obj
Public Function GetSelectedDataSource () As Object

Retornos

Object

O objeto de fonte de dados selecionado no momento desse provedor de fonte de dados.The currently selected data source object of this data source provider.

Exemplos

O exemplo de código a seguir implementa GetSelectedDataSource os GetResolvedSelectedDataSource métodos e da IDataSourceProvider interface.The following code example implements both the GetSelectedDataSource and GetResolvedSelectedDataSource methods of the IDataSourceProvider interface. O GetSelectedDataSource método é usado para garantir que a fonte de dados associada ao controle em tempo de design seja um objeto que implementa a IEnumerable interface.The GetSelectedDataSource method is used to ensure that the data source associated with the control at design time is an object that implements the IEnumerable interface. Isso permite que os usuários iterem na fonte de dados.This allows users to iterate through the data source.

<FileName>databounddesigner.vb</FileName>
<RelevantItems>
  <Reference>System.Web.UI.Design.IDataSourceProvider.GetResolvedSelectedDataSource</Reference>
  <Reference>System.Web.UI.Design.IDataSourceProvider.GetSelectedDataSource</Reference>
</RelevantItems>

Aplica-se a