Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns a safe version of the connection string with sensitive parts, such as passwords, removed.
Namespace: Microsoft.Data.Schema
Assembly: Microsoft.Data.Schema (in Microsoft.Data.Schema.dll)
Syntax
'Declaration
Public Shared Function MakeSafeToPersist ( _
connectionString As String, _
adoDataProviderName As String _
) As String
public static string MakeSafeToPersist(
string connectionString,
string adoDataProviderName
)
public:
static String^ MakeSafeToPersist(
String^ connectionString,
String^ adoDataProviderName
)
static member MakeSafeToPersist :
connectionString:string *
adoDataProviderName:string -> string
public static function MakeSafeToPersist(
connectionString : String,
adoDataProviderName : String
) : String
Parameters
- connectionString
Type: System.String
The connection string to be secured.
- adoDataProviderName
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 valid connection string with sensitive information removed.
Remarks
The removed sensitive parts are encrypted and stored in the registry so that they can be restored by the RestoreConnectionString method.
.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.