DatabaseFactory.CreateDatabase Method (String)
Creates the Database object with the specified name.
Namespace: Microsoft.Practices.EnterpriseLibrary.Data
Assembly: Microsoft.Practices.EnterpriseLibrary.Data (in Microsoft.Practices.EnterpriseLibrary.Data.dll) Version: 6.0.0.0 (6.0.1304.0)
Syntax
public static Database CreateDatabase(
string name
)
'Declaration
Public Shared Function CreateDatabase (
name As String
) As Database
public:
static Database^ CreateDatabase(
String^ name
)
Parameters
- name
Type: System.String
The configuration key for database service
Return Value
Type: Database
The database with the specified name
Examples
Database dbSvc = DatabaseFactory.CreateDatabase("SQL_Customers");
Exceptions
Exception | Condition |
---|---|
System.Configuration.ConfigurationErrorsException | The configuration information cannot be read. |
System.InvalidOperationException | The database factory has not been intialized or some configuration information is missing. |