C# Class Elmah.ConnectionStringHelper

Helper class for resolving connection strings.
Mostra file Open project: elmah/Elmah Class Usage Examples

Public Methods

Method Description
GetConnectionString ( System.Collections.IDictionary config ) : string

Gets the connection string from the given configuration dictionary.

GetConnectionString ( System.Collections.IDictionary config, bool resolveDataSource ) : string

Gets the connection string from the given configuration, resolving ~/ and DataDirectory if necessary.

GetConnectionStringProviderName ( System.Collections.IDictionary config ) : string

Gets the provider name from the named connection string (if supplied) from the given configuration dictionary.

GetDataSourceFilePath ( string connectionString ) : string

Extracts the Data Source file path from a connection string ~/ gets resolved as does |DataDirectory|

GetResolvedConnectionString ( string connectionString ) : string

Converts the supplied connection string so that the Data Source specification contains the full path and not ~/ or DataDirectory.

Private Methods

Method Description
GetDataSourceFilePath ( DbConnectionStringBuilder builder, string connectionString ) : string
MapPath ( string path ) : string
ResolveDataSourceFilePath ( string path ) : string

Method Details

GetConnectionString() public static method

Gets the connection string from the given configuration dictionary.
public static GetConnectionString ( System.Collections.IDictionary config ) : string
config System.Collections.IDictionary
return string

GetConnectionString() public static method

Gets the connection string from the given configuration, resolving ~/ and DataDirectory if necessary.
public static GetConnectionString ( System.Collections.IDictionary config, bool resolveDataSource ) : string
config System.Collections.IDictionary
resolveDataSource bool
return string

GetConnectionStringProviderName() public static method

Gets the provider name from the named connection string (if supplied) from the given configuration dictionary.
public static GetConnectionStringProviderName ( System.Collections.IDictionary config ) : string
config System.Collections.IDictionary
return string

GetDataSourceFilePath() public static method

Extracts the Data Source file path from a connection string ~/ gets resolved as does |DataDirectory|
public static GetDataSourceFilePath ( string connectionString ) : string
connectionString string
return string

GetResolvedConnectionString() public static method

Converts the supplied connection string so that the Data Source specification contains the full path and not ~/ or DataDirectory.
public static GetResolvedConnectionString ( string connectionString ) : string
connectionString string
return string