Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am having a Windows form application created using C# .Net Framework 3.5. My application is using a SQL SERVER 2005 database. My customer has got the SQL Server installed in his machine. How can I get the database installed too? Do have to do some thing using SQL SERVER CONFIGURATION MANAGER? Is it possible to install the database directly using my software setup file? Please someone help me out!!!
Posted

You can't install a database, but you can back up the database and restore the database on another computer. Have a look at this discussion:
http://stackoverflow.com/questions/8715687/how-to-copy-a-database-from-one-computer-to-another[^]
 
Share this answer
 
You would need to create a setup that creates/deploy database along with your application install.

Have a look at these:
Creating setup With support for database creation Using VS.NET[^]
Create database during installation of a .NET application [^]
Deploy your Application and Database[^]
 
Share this answer
 
when you are create setup add database bak file or script file.

now,
when application start connect with sql master database
fire query that checks whether database exist or not
if not then,

1. if you have added .bak file in setup,
then first execute query for create database and then execute restore database query from .net, then re-create connection to your database(leave master database connection)

2. if you added script then same way
then first execute query for create database and then read script file and assign in cmd.commandtext then execute that command

Happy Coding!
:)
 
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