Am new to programming but I have a C# desktop application developed with Visual Studio 2015 and connected to SQL server 2012 which I want install on a different computer. My question is, do I have to create the same database and tables I created for the application on the new computer or it will be created automatically when the application is run?. Secondly can any edition of SQL server(eg. SQL server 2015) connect to the application on the new computer?. Thank you.
Asked
Active
Viewed 330 times
0
-
1SQL Server doesn't connect to the application, the application connects to SQL Server; and whether that application connects and functions properly depends on the drivers configured and installed and if they support that version of SQL Server. As for "will be created automatically when the application is run" that completely depends on how you creation the installation package. (Also there is no SQL Server 2015.) – Thom A Mar 10 '21 at 10:31
-
This resource to your application create all database artifacts when application run is [Entity Framework with Migrations](https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli). Is your application developed with this resources? – Antonio Leonardo Mar 10 '21 at 10:32
-
No, the application was not developed with that resource. – emma aboagye Mar 11 '21 at 09:37
1 Answers
1
It depends on your approach (if its code first approach or database first approach). If you are working with a code first approach then you don't need to create the database, you have to only run the migrations; your database and tables will automatically be created. If you are working with a database first approach then you need to create your database and objects.
If you are working with localhost then you need to connect to the new computer.

Anouar
- 2,050
- 1
- 15
- 25

Kartik Bargal
- 26
- 2