Delen via


SqlConnectionEncryptOption Class

Definition

These options are used to control encryption behavior of the communication between the server and the client.

public ref class SqlConnectionEncryptOption sealed
public sealed class SqlConnectionEncryptOption
[System.ComponentModel.TypeConverter(typeof(Microsoft.Data.SqlClient.SqlConnectionEncryptOptionConverter))]
public sealed class SqlConnectionEncryptOption
type SqlConnectionEncryptOption = class
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Data.SqlClient.SqlConnectionEncryptOptionConverter))>]
type SqlConnectionEncryptOption = class
Public NotInheritable Class SqlConnectionEncryptOption
Inheritance
SqlConnectionEncryptOption
Attributes

Remarks

Implicit conversions have been added to maintain backwards compatibility with boolean behahavior for the Encrypt property. When converting from a boolean, a value of true converts to Mandatory and a value of false converts to Optional. When converting to a boolean, Mandatory, Strict , and null convert to true and Optional converts false.

Constructors

SqlConnectionEncryptOption()

Properties

Mandatory

Specifies that TLS encryption is required when connecting to the server. If the server doesn't support encryption, the connection will fail.

Optional

Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated.

Strict

Enables and requires TDS 8.0, TLS encryption to the server. If the server doesn't support TDS 8.0, TLS encryption, the connection will fail.

Methods

Equals(Object)

Compares the ToString() representation of SqlConnectionEncryptOption to another SqlConnectionEncryptOption.

GetHashCode()

Returns the hash code of the ToString() value.

Parse(String)

Converts the specified string representation of a logical value to its SqlConnectionEncryptOption equivalent.

ToString()

Returns the string value of SqlConnectionEncryptOption.

TryParse(String, SqlConnectionEncryptOption)

Converts the specified string representation of a logical value to its SqlConnectionEncryptOption equivalent and returns a value that indicates whether the conversion succeeded.

Operators

Implicit(Boolean to SqlConnectionEncryptOption)

Enables implicit converstion of a boolean to a SqlConnectionEncryptOption. A value of true converts to Mandatory. A value of false converts to Optional.

Implicit(SqlConnectionEncryptOption to Boolean)

Enables implicit converstion of a SqlConnectionEncryptOption to a boolean. Mandatory and Strict convert to true. Optional converts to false.

Applies to