SqlConnectionStringBuilder.PersistSecurityInfo Property

Definition

Gets or sets a Boolean value indicating if security-sensitive information, such as the password or access token, should be returned as part of the connection string on a connection created with this SqlConnectionStringBuilder after that connection has ever been in an open state. This property should only be set to true if your application has a specific need to read the password out of an already-opened database connection. The default value of false is the more secure setting; using true for this property opens your application to security risks such as accidentally logging or tracing the database password.

public:
 property bool PersistSecurityInfo { bool get(); void set(bool value); };
public bool PersistSecurityInfo { get; set; }
member this.PersistSecurityInfo : bool with get, set
Public Property PersistSecurityInfo As Boolean

Property Value

The value of the PersistSecurityInfo property, or false if none has been supplied.

Remarks

This property corresponds to the "Persist Security Info" and "persistsecurityinfo" keys within the connection string.

Resetting the connection string resets all connection string values including the password.

Applies to