Database::Exists Method
Checks whether or not the database exists on the server.
Assembly: EntityFramework (in EntityFramework.dll)
| Name | Description | |
|---|---|---|
![]() | Exists() | Checks whether or not the database exists on the server. |
![]() ![]() | Exists(DbConnection^) | Checks whether or not the database exists on the server. |
![]() ![]() | Exists(String^) | Checks whether or not the database exists on the server. The connection to the database is created using the given database name or connection string in the same way as is described in the documentation for the DbContext class. |
Database::Exists Method (DbConnection^)
Checks whether or not the database exists on the server.
Parameters
- existingConnection
-
Type:
System.Data.Common::DbConnection^
An existing connection to the database.
Database::Exists Method (String^)
Checks whether or not the database exists on the server. The connection to the database is created using the given database name or connection string in the same way as is described in the documentation for the DbContext class.
public: [SuppressMessageAttribute("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] static bool Exists( String^ nameOrConnectionString )
Parameters
- nameOrConnectionString
-
Type:
System::String^
The database name or a connection string to the database.

