I’ve created my 1st c# MVC3 EntityFramework app and moved in into the IIS folder… after running it locally it goes
CREATE DATABASE permission denied in database ‘master’.
The problem is that I’ve already created SQL account in MS SQL Management Studio and my connection string has the login and passwork inputed like this:
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;user id=kwestionariusz;password=PASSWORD;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
Also, I’ve added the same into this, I dunno if it’s necessary though:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; user id=kwestionariusz; password=PASSWORD; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
Am I missing something?
If you are using code first, then make sure that the user has the permission to create the database.
The name of the connection must match the classname of the db context:
If your database is already there, modify the constructor of your DbContext: