"CREATE DATABASE permission refused in database'master'," says EF Code First.

c# ef-code-first entity-framework sql-server-2008

Question

I just want to launch my development environment's default database as soon as possible.

What is the most straightforward solution to this issue?

1
3
10/6/2011 9:46:28 AM

Popular Answer

I've had this issue before and found a solution. Using SQL authentication rather than Windows' is crucial. The best approach to set the default database is in this manner.

Try the following connection string:

<add name="MFCConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MFC.mdf;Initial Catalog=MFC;Integrated Security=false;User ID=sa;Password=123"
  providerName="System.Data.SqlClient" />

Keep in mind to set the integrated security parameter to false and the default database of the SA to MFC. Aside from that, sa is often deactivated, so turn it on and test it in sql server management studio first.

3
9/6/2013 2:49:01 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow