ConnectionStringSecurer.RestoreConnectionString Method

Restores a safe partial connection string to its full form, which includes sensitive information such as passwords.

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

Syntax

'Declaration
Public Shared Function RestoreConnectionString ( _
    partialConnection As String, _
    dbProvider As String _
) As String
public static string RestoreConnectionString(
    string partialConnection,
    string dbProvider
)
public:
static String^ RestoreConnectionString(
    String^ partialConnection, 
    String^ dbProvider
)
static member RestoreConnectionString : 
        partialConnection:string * 
        dbProvider:string -> string 
public static function RestoreConnectionString(
    partialConnection : String, 
    dbProvider : String
) : String

Parameters

  • dbProvider
    Type: System.String
    The name of the ADO.NET data provider for the connection string, such as "System.Data.SqlClient" for SQL Server.

Return Value

Type: System.String
A connection string with all sensitive information fully restored.

Remarks

The user must be the same user who executed the MakeSafeToPersist, and the method must be called on the same computer.

.NET Framework Security

See Also

Reference

ConnectionStringSecurer Class

Microsoft.Data.Schema Namespace

MakeSafeToPersist