Click here to Skip to main content
15,669,524 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have developed one software in C#. Now I am creating setup project and add all the Prerequisites that are needed in project.

Now i want that setup will install the database along with setup.

It will check that database is exists or not.

If database is not exists then it will create the database and insert the data along with setup.

IF database is exists then it will just installed my developed software and skipped the database portion.

so it can be achieve or not ?

I am using VS installer to create setup

Database : SQL Server express database

What I have tried:

found that using DbUp can be do but never tried
Updated 18-Nov-21 5:21am
PIEBALDconsult 18-Nov-21 8:25am    
I recommend not trying to do that. You can specify that the user needs to provide an SQL Server instance, but do not attempt to install one for him. Allow the user to install the database (full or express) he chooses, where he chooses. The user may already have a full SQL Server instance on another system he wants to use to host the database.
Trying to install what the user doesn't want will only cause you both trouble.
Devendra Sarang 18-Nov-21 9:57am    
my concern is not sql server instance. My concern is it should install database

1 solution

It's pretty easy to check:
               FROM master.dbo.databases 
               WHERE Name = 'MYTestDatabaseName')
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