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.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public static bool Exists(
	string nameOrConnectionString


Type: System.String

The database name or a connection string to the database.

Return Value

Type: System.Boolean
True if the database exists; false otherwise.