Click here to Skip to main content
15,918,007 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have an application that uses SQL Server Express. How to make setup that will install the application on client's computer?

I searched a lot on google but nothing found helpful.

Also tried this link http://www.codeproject.com/KB/database/Deploy_your_database.aspx

but got stuck on step 3. Please help.

Thanks
Posted
Updated 18-Jan-12 4:48am
v2

when pulishing application ensure you sql server express as prequisite and select
download prequisite from same location
 
Share this answer
 
Comments
Furqan Sehgal 18-Jan-12 10:41am    
yeah that is ok. But how to install my database? I have taken backup using SSME and result file is in my application folder. How to attach it with the sql server of my client's machine?
I'm not entirely sure if this will help, but just in case: Xcopy Deployment(SQL Server Express)[^]
 
Share this answer
 
Comments
Furqan Sehgal 18-Jan-12 11:03am    
Xcopy means I give user just exe files and mdf files. But the question is, will this work on sharing (LAN)?
You need to restore the database.

1. Install SQL Express, make sure to have all the settings for file locations etc. right
2. connect to the SQL Server Express instance
3. create a sql script that restores the database
Sample:
SQL
create database myDatabase;
go
RESTORE DATABASE myDatabase
   FROM DISK = 'c:\pathToBackupFile\myDatabase.bak';


Look here for options of the restore command:
http://msdn.microsoft.com/en-us/library/ms186858.aspx[^]
 
Share this answer
 
Comments
Furqan Sehgal 19-Jan-12 9:15am    
You mean I attach database to SSMS and take backup. Then restore that using my code? Where to write the code you gave?
Heino Zunzer 19-Jan-12 12:24pm    
You can either use sqlcmd command line tool (http://msdn.microsoft.com/en-us/library/ms162773.aspx) or use the same method you are using in your code to connect to the Sql Server.

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