In Entity Framework avoid creating database if not exist when db instance created.

In entity framework code first approach, while creating the instance of database context it will automatically create the database. To avoid creation of database simple add the below one line code in Global.asax.cs Application_Start() event.

protected void Application_Start() { System.Data.Entity.Database.SetInitializer<Models.SampleModeEntities>(null); }

In the above example Models.SampleModeEntities is dbcontext name, change the value with your model dbcontext name.