Entity Framework - Code Firts

0

If I have a desktop application (Windows Forms) developed with EF code firts but the connection to the database of my pc is Windows authentication (to the SQL server). But when taking it to another PC they have a SQL server with SQL user authentication and password, when executing my application, would the database be created?

    
asked by Pedro Ávila 12.10.2016 в 05:31
source

2 answers

0

Let's start from the base that the type of authentication does not have any relationship with the creation or not of the database.

In addition, if EF does not create the database, unless you define it in the initialization configuration

Database Initialization Strategies in Code-First

but you could define other strategies such as being updated in case of finding a difference with the model or simply not doing anything (with which you would have an exception).

On the one hand is the way you authenticate and another would be the Source and Database that you define in the connection string, you could define two different forms of authentication (integrated to windows or by means of username and password) and both connect normally to the same database.

    
answered by 12.10.2016 / 06:31
source
1

I would not walk, I understand that you would have to configure that user and pass of sql when you set up the EF in your app. What you could try would be to configure that user and pass in the EF, then compile and take the DLLs to the "other pc". Greetings

    
answered by 12.10.2016 в 05:54