Avatar of McCoin
McCoin

asked on 

Install SQL Express including database in deployment project

I have a windows C# applicaiton that uses SQL Express as it's backend.
I need to be able to include the installation of SQL Express in the setup deployment project.
I also need the database to be installed on the "stand-alone" pc including security settings (users, etc.).

I would greatly appreciate the help.

Thanks
C#

Avatar of undefined
Last Comment
McCoin
Avatar of Deepak_Syd
Deepak_Syd
Flag of Australia image

You an add SQL Server Express by clicking on Prerequisites button on project properties for your setup project.

Deepak
Avatar of McCoin
McCoin

ASKER

Thanks for the reply.
I did find the prereq section on the setup project, and I assumed it checks whether it was already on the client or not then decides whether or not to install it. The major issue, is how do I take my current database (Schema) and install it (or attach it) to the clients version of sql express?

That way all the permissions, tables, stored procs, etc. are already there.

Thanks
just create your database inside your application, sending proper queries to create the tables, and other elements.
you can use a stored procedure to test if the database is installed or this is the first time you run your application.
Avatar of McCoin
McCoin

ASKER

What do you mean "create your database inside your application".
Do you mean when the application starts up check to see if the database exists, if not, then create it?

Thanks again.
>>Do you mean when the application starts up check to see if the database exists, if not, then create it?
yes, if it doesn't exist, run the queries to create it, you can have stored all the queries in a string, maybe into your application settings.
Avatar of McCoin
McCoin

ASKER

Is there anyway to create some type of installer that is ran upon setup that does all this for you? I'd rather not have that check everytime the application starts up.

That's fine if there's no other way to do this, but I'd rather not.

Thanks again
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of McCoin
McCoin

ASKER

Fair enough,
Thanks for the help
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo