Hello everyone,
I am interested in creating WPF applications with EntityFramework. I am new in this stuff and my main problem is how to install this kind of applications on other computers.
I have created my first app with Entity Framework:
First of all, I have created my database with SQL Server Management Studio. Then I generated Data Model in Visual Studio from previously created database. Everything works fine on my PC (database exists, my app uses it successfully). Anyway I would like to install my application on other computer where my database doesn't exist but my app strictly needs it. Is there any complex method to install this app on other PC immediately with this database? Or do I need first to run a database service manually, then install an application?
I hope you give me some good instructions how to do it. I would be really grateful...
Loading
Guest UserPosted Aug 14, 2014, 8:06 PM
+ rather SQLServer, you can use localDB which ships db alongwith your application. generally it's saved in App_Data folder
+ if you want to continue with SQL Server mgmt studio and it doesn't exist at other PC then you need to install it using installer. however you can automate the task of creating your database at sqlserver using scripts, e.g.,
-> export your existing db using
BACKUP DATABASE northwind
TO DISK = 'C:\client_deployments\northwind.BAK'
-> at other PC you can use below command
RESTORE DATABASE northwind
FROM DISK = 'C:\client_deployments\northwind.BAK'
The above commands will fire from sql server management console .
If you want to automate using Command Shell then you can generate DACPAC file from existing database and import that dacpac at target PC. Use sqlcmd for the same. Let me know if you need information on DACPAC
"Please mark it Accepted if this is useful to you"