Click here to Skip to main content
16,017,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts,
I am doing a windows application using visual studio 2010, c# 4.0 and sql server 2008. I have already finished my project and testing. Now i want to deploy my project with sql server database so that my client when install my software, installation wizard configure database on local machine, create database, creates all required tables and stored procedures.

How can i do this? Please suggest me step by step process as i am new to this.
Posted
Updated 13-Nov-17 20:30pm
Comments
Ranjeet Patel 28-Oct-14 6:27am    
Where do you want to keep your database. Is it on client machine or you have some centralized server. If client side you can have database.mdf file and keep your database structure in that.
Sunil Kumar Pandab 28-Oct-14 6:36am    
Yes database will be at client machine. How to do that pls suggest me. Is that need sql server to install in client machine. Or how can i do this?
Ranjeet Patel 3-Nov-14 2:54am    
See if you know, that the database can have .mdf file detachable. You can use this file to store in a particular folder and give the connection string to that file and then you can use that file as you use the server database to store the data. remember If that file is deleted from client machine your whole data will be deleted.

Hi,

if you developed using SQL server then you need to install it at client end.

How top deploy :

1. Now you can create a backup your DB and restore it at client's SQL server
2. If you using some ORM then your could generate you DB from it (but not store procedure and functions)
3. You can provide a script back up of your DB and ask client to run that on his sql server, you can patch the same within the exe and run those sql's on app start if tables not exists.

SQL Server backup Restore : http://msdn.microsoft.com/en-us/library/ms187048.aspx[^]

ORM (Entity Framework) Create DB : http://www.entityframeworktutorial.net/code-first/database-initialization-strategy-in-code-first.aspx[^]

Database SQL Script Generation : http://msdn.microsoft.com/en-IN/library/hh245282.aspx[^]
 
Share this answer
 
Comments
Sunil Kumar Pandab 28-Oct-14 7:06am    
Then client needs to install sql server before install my application. Is there any option to install my application that installs sql server first in client machine.
Suvabrata Roy 28-Oct-14 14:14pm    
Yes you can...

View : http://www.codeproject.com/Articles/35976/Add-Prerequisites-of-NET-Framework-in-Visual-Studi
Another http://msdn.microsoft.com/en-us/library/ms165429.aspx

Most interesting : http://www.codeproject.com/Articles/10032/Deploy-SQL-Server-databases-easily-with-an-Install
you can create setup project for your solution, using visual studio or something like install shield.
i suggest you if your application is capable using sql server express 2008 you can easily create setup project and makes your sql express bootstrap to install automatically on your clients systems using visual studio setup project. then create wizard for creation db and tables on your first start of your application on client side or copy your db then refer your connection string in your app.config.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900