views:

268

answers:

2

I've written an app that needs a database. I've been using a local copy of SQL Server on my machine but would like to build a setup for this application that installed it's own database to support the application. I'd rather not have to have the user install SQL on their own and then configure the application.

Can anyone point me in the right direction here?

+1  A: 

Create a Setup and Deployment > Setup project in Visual Studio - you can add pre-requisites like enforcing .net framework version, install SQL express and generally configure files/folders/shortcuts.

You can use the attach db file method of the connnection string to actually attach the mdf to the sql server - or - you can write your own sql scripts to run if you need more complex set-ups.

Chris W
I am able to get this far, except I don't see any options to install SQL Express or anything.
jim
This other question has some links that give full steps: http://stackoverflow.com/questions/900866/embedding-sql-server-express-2005-with-my-application
Chris W
+1  A: 

Here is a good article on embedding SQL Server Express in your application and then deploying it.

jim