ConnectionStringsExpressionBuilder.GetConnectionString(String) Method

Definition

Returns a connection string from the <connectionStrings> section of the Web.config file.

public:
 static System::String ^ GetConnectionString(System::String ^ connectionStringName);
public static string GetConnectionString (string connectionStringName);
static member GetConnectionString : string -> string
Public Shared Function GetConnectionString (connectionStringName As String) As String

Parameters

connectionStringName
String

The name of the connection string.

Returns

The connection string as a String for this connection string name.

Exceptions

The connection string name could not be found in the Web.config file.

Remarks

The ConnectionStrings property returns a collection of connection string values. The GetConnectionString method returns the value from this collection that is associated with the connection string name.

Applies to

See also