Question SQL Express Deployment

inkedgfx

Well-known member
Joined
Sep 29, 2012
Messages
139
Location
USA
Programming Experience
Beginner
I would like to know how to deploy a SQL Database with my Program...what I mean is are there extra steps in creation of the setup program to insure the end user will have no problems when installing the program from a setup installer? will the setup take care of everything needed to run the program with a database connected to it?

InkedGFX
 
Hi,

From a personal experience point of view, when I need to deploy an SQL Server Database with my application at a clients location I always go and do it myself on site so that I know everything is setup correctly for the application to work.

That said, if you want to automate the process with a setup project then have a look at this. You will see that there is a lot to do and it's not that straight forward:-

Deploy your Application and Database - CodeProject

You will also need to consider adding a pre-requisite for the SQL Server version you are using to ensure that an instance of SQL server is installed at the client end.

If you need further information on getting started with a setup project then just browse the net since there are loads of examples on there.

Hope that helps.

Cheers,

Ian
 
thanks for the reply.....I guess I wont be adding a database to my projects then....since Microsoft doesnt make it user friendly to do so.......

InkedGFX
 
Hi,

Using a database is easy and relatively straight forward but there are a lot of other issues to consider other then just reading and writing to and from a data source.

As a quick and easier alternative to using a database such as SQL Server, why not try using a file to hold your information. With a bit of work you should be able to get this working pretty quickly and it's one heck of a lot easier to deploy as part of an applications overall solution.

There are two main ways you could achieve this:-

1) You could use a Binary or XML Formatter in conjunction with a Stream to Serialize and Deserialize the myQuestions Dictionary to a flat file on the hard disk.

2) You could use a DataSet to hold your information and then look into the DataSet.WriteXml and DataSet.ReadXml methods which read and write to and from a flat file on the hard disk.

There are loads of examples on the net of how to get going with either of these options if you want to explore these avenues.

Hope that helps.

Cheers,

Ian
 
I think that IanRyder may have scared you off a bit here. Using a database is easy and deploying it is easy. If you have installed SQL Server Express on your development machine then you can add a database to your project the same way you add any other item, selecting Server-based Database as the item template. When it comes time to deploy, you simply ensure that SQL Server Express is checked in the Prerequisites dialogue of your installer. That's the bones of it.
 
I was hoping it wasnt as difficult to deploy as it was to install...lol

I have a simple database in my program...maybe I will continue to develop it...thanks for the reply

InkedGFX
 
I have installed SQL Server Express many times and it is quite simple. Either something out the ordinary went wrong for you or you did something wrong. While it's not guaranteed, in my experience, the most likely explanation is that you didn't read the instructions and did something wrong. Deploying SQL Server Express with your app is at most a few clicks and may not even be that as it might actually be selected as a prereqisite by default for ClickOnce when you add a database to your project.
 
Back
Top