Partager via


IVsDataConnectionDialog.AddSources Method (DataConnectionDialogFilterCallback)

Enumerates all registered data sources and their associated data providers, and conditionally adds source/provider combinations to the Choose/Change Data Source dialog box, depending on logic in the supplied callback.

Namespace:  Microsoft.VisualStudio.Data.Services
Assembly:  Microsoft.VisualStudio.Data.Services (in Microsoft.VisualStudio.Data.Services.dll)

Syntax

'Déclaration
Sub AddSources ( _
    callback As DataConnectionDialogFilterCallback _
)
void AddSources(
    DataConnectionDialogFilterCallback callback
)
void AddSources(
    DataConnectionDialogFilterCallback^ callback
)
abstract AddSources : 
        callback:DataConnectionDialogFilterCallback -> unit 
function AddSources(
    callback : DataConnectionDialogFilterCallback
)

Parameters

Remarks

This method allows a client to be selective about which data sources and providers are available in the Choose/Change Data Source dialog box. Using the callback method, they can selectively include or exclude certain sources or providers depending on arbitrary logic.

For example, you could use this method to determine which data providers should be shown when adding a given data connection to Server Explorer. Because a Server Explorer connection requires implementation of the DataViewSupport support entity, the code that shows the dialog box for this purpose could filter out all providers that do not support this entity.

.NET Framework Security

See Also

Reference

IVsDataConnectionDialog Interface

AddSources Overload

Microsoft.VisualStudio.Data.Services Namespace