Database.OpenConnectionString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OpenConnectionString(String) |
Opens a connection to a database using the specified connection string. |
OpenConnectionString(String, String) |
Opens a connection to a database using a connection string and the specified provider. |
OpenConnectionString(String)
Opens a connection to a database using the specified connection string.
public static WebMatrix.Data.Database OpenConnectionString (string connectionString);
static member OpenConnectionString : string -> WebMatrix.Data.Database
Public Shared Function OpenConnectionString (connectionString As String) As Database
Parameters
- connectionString
- String
The connection string that contains information that is used to connect to a database.
Returns
The database instance.
Exceptions
connectionString
is null or empty.
Applies to
OpenConnectionString(String, String)
Opens a connection to a database using a connection string and the specified provider.
public static WebMatrix.Data.Database OpenConnectionString (string connectionString, string providerName);
static member OpenConnectionString : string * string -> WebMatrix.Data.Database
Public Shared Function OpenConnectionString (connectionString As String, providerName As String) As Database
Parameters
- connectionString
- String
The connection string that contains information that is used to connect to a database.
- providerName
- String
(Optional) The name of the .NET Framework data provider to use to connect to the data source.
Returns
The database instance.
Exceptions
connectionString
is null or empty.