IVsDataExplorerConnectionManager.AddConnection Method
Adds a new data connection with the specified properties.
Namespace: Microsoft.VisualStudio.Data.Services
Assembly: Microsoft.VisualStudio.Data.Services (in Microsoft.VisualStudio.Data.Services.dll)
Syntax
'Declaration
Function AddConnection ( _
connectionName As String, _
provider As Guid, _
connectionString As String, _
encryptedString As Boolean _
) As IVsDataExplorerConnection
IVsDataExplorerConnection AddConnection(
string connectionName,
Guid provider,
string connectionString,
bool encryptedString
)
IVsDataExplorerConnection^ AddConnection(
String^ connectionName,
Guid provider,
String^ connectionString,
bool encryptedString
)
abstract AddConnection :
connectionName:string *
provider:Guid *
connectionString:string *
encryptedString:bool -> IVsDataExplorerConnection
function AddConnection(
connectionName : String,
provider : Guid,
connectionString : String,
encryptedString : boolean
) : IVsDataExplorerConnection
Parameters
connectionName
Type: System.StringThe name of the data connection.
provider
Type: System.GuidThe GUID of the DDEX provider.
connectionString
Type: System.StringThe connection string, in unencrypted or encrypted form, containing the connection properties.
encryptedString
Type: System.BooleanA Boolean value indicating whether the connectionString parameter is encrypted (true) or not (false).
Return Value
Type: Microsoft.VisualStudio.Data.Services.IVsDataExplorerConnection
An IVsDataExplorerConnection object representing the new data connection.
Remarks
When you create a new connection, the name of the data connection in the Visual Studio Server Explorer is by default a composite string consisting of the server name, database name, and schema. However, you can supply a custom name for the data connection. This method allows you to set the data connection name.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.