Change the database instance

0

I'm doing a project in MVC and my problem is that my database is automatically created in the "localdb" instance, but I wanted it to be created in my instance that I created in SQL Server. p>

Is there a possibility to change this? And if it exists, can I change right away when I create the project?

    
asked by anonymous 05.12.2017 / 17:43

1 answer

0

Open the file web.config and look for the connectionStrings section.

There will probably be a add tag that contains the string connection that points to LocalDB.

Change it to look like this - obviously you will need to use your SQL Server connection data.

<connectionStrings>
    <add name="DefaultConnection" 
       connectionString="Server=.\SQLEXPRESS;Initial Catalog=Nome-Banco;Uid=User;Pwd=Senha;PersistSecurityInfo=True" 
       providerName="System.Data.SqlClient" />
</connectionStrings>
    
05.12.2017 / 17:56