If you are using a centralized database (i.e. you set up the database on a SQL Server machine that everyone needs to access) then your setup program will need to set up the appropriate connection string. Whether you require your users to enter this manually or you hard code it in your
app's config
is up to you. There are benefits to both sides. In this case though you would just deploy your application while the centralized DB server would already have the database.
Firstly you would need to either deploy the SQL scripts to build the database or get the database from the development server (detach temporarily) and include it in your setup. During installation you'll need to prompt the user for the deployment database. You'll likely need database credentials as well. You can then use any of the
SQL APIs
(SMO is a good choice) to create and attach your database to the SQL server. You'll also need to set up permissions perhaps. You probably also want to handle the case of the database already existing as well.
So Finally if you want a centralized database from which all users work then you need to go with the centralized SQL database route. In this case you need to secure licenses for everyone (if appropriate) but database deployment is independent of application deployment.
ClickOnce
might be the way to go for your application. If each user gets their own database then
SQL CE
is the simplest if you can live with the limitations or SQL Express otherwise but you need to confirm SQL Express exists before your app installs.
Take a look
there-[Solution Deployment (Database Engine)][
^] and
there-[Xcopy Deployment (SQL Server Express)][
^]