Share via


EntityConnection.ConnectionString Property

Definition

Gets or sets the EntityConnection connection string.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public override string ConnectionString { get; set; }
member this.ConnectionString : string with get, set
Public Overrides Property ConnectionString As String

Property Value

The connection string required to establish the initial connection to a data source. The default value is an empty string. On a closed connection, the currently set value is returned. If no value has been set, an empty string is returned.

Attributes

Exceptions

An attempt was made to set the ConnectionString property after the EntityConnection ’s MetadataWorkspace was initialized. The MetadataWorkspace is initialized either when the EntityConnection instance is constructed through the overload that takes a MetadataWorkspace as a parameter, or when the EntityConnection instance has been opened.

An invalid connection string keyword has been provided or a required connection string keyword has not been provided.

Applies to