Share via


SqlUserInteractionServices.TryConstructConnectionStringAndProvider Method

Used to get the SQL Server -specific connection string and SQL Server provider

Namespace:  Microsoft.Data.Schema.Sql
Assembly:  Microsoft.Data.Schema.Sql (in Microsoft.Data.Schema.Sql.dll)

Syntax

'Declaration
Public Overrides Function TryConstructConnectionStringAndProvider ( _
    connectionString As String, _
    databaseName As String, _
    <OutAttribute> ByRef provider As Guid, _
    <OutAttribute> ByRef formattedConnectionString As String _
) As Boolean
public override bool TryConstructConnectionStringAndProvider(
    string connectionString,
    string databaseName,
    out Guid provider,
    out string formattedConnectionString
)
public:
virtual bool TryConstructConnectionStringAndProvider(
    String^ connectionString, 
    String^ databaseName, 
    [OutAttribute] Guid% provider, 
    [OutAttribute] String^% formattedConnectionString
) override
abstract TryConstructConnectionStringAndProvider : 
        connectionString:string * 
        databaseName:string * 
        provider:Guid byref * 
        formattedConnectionString:string byref -> bool 
override TryConstructConnectionStringAndProvider : 
        connectionString:string * 
        databaseName:string * 
        provider:Guid byref * 
        formattedConnectionString:string byref -> bool 
public override function TryConstructConnectionStringAndProvider(
    connectionString : String, 
    databaseName : String, 
    provider : Guid, 
    formattedConnectionString : String
) : boolean

Parameters

  • databaseName
    Type: System.String
    The name of the database to which you connect.
  • provider
    Type: System.Guid%
    The returned GUID of the provider.
  • formattedConnectionString
    Type: System.String%
    The returned formatted connection string.

Return Value

Type: System.Boolean
true if the method was able to construct the connection string and get the correct GUID.

Remarks

This information is used to add the connection to Server Explorer.

.NET Framework Security

See Also

Reference

SqlUserInteractionServices Class

Microsoft.Data.Schema.Sql Namespace