Solved

How would I create a Database Application without the end user having to install a Database Server

Posted on 2014-10-29
8
178 Views
Last Modified: 2014-10-30
Hi,

I'm looking to develop a very simple database application that will need to read and write data to maybe 3 or 4 tables. I have SQL Server Express 2008 installed on my dev pc, and will be coding in VS2008 / C#.

I'd like to be able to deploy my application with a simple setup file (exe / msi) and have the end user simply install it and go. I'm looking at ideas on how I would go about creating / shipping the actual datasource. Every thing I search for online regarding database and visual studio ALWAYS talks about installing SQL Server (CE / Express / Full etc.), but I'd rather not have to ask the users of my application to install a separate program.

Not really looking for specific answers here, just a few general ideas on how to create and ship a database application without the user having to install a database server.

Thanks

Chris
0
Comment
Question by:Chris Stanyon
8 Comments
 
LVL 5

Accepted Solution

by:
SerjTech earned 100 total points
ID: 40412292
Might be worth looking at either:

SQL Server Compact
http://msdn.microsoft.com/en-us/data/ff687142

or SQLite
http://www.sqlite.org/

Your basically looking for a self contained / serverless database
0
 
LVL 24

Assisted Solution

by:chaau
chaau earned 100 total points
ID: 40412293
I would suggest you use SQLite. It has a SQLite.net module which is supported by the community. Then, when you ship your program you would either ship it with an empty .sqlite database or have the program to create one upon first launch. The latter option will require you to run a couple of "CREATE TABLE" commands from within the application itself. I actually prefer the latter option as it allows you to add/modify the tables should your new software updates require database changes.
0
 
LVL 22

Assisted Solution

by:Snarf0001
Snarf0001 earned 100 total points
ID: 40412295
You can also look at SQL Server LocalDB:

http://msdn.microsoft.com/en-CA/library/hh510202.aspx

Was designed to do pretty much what you're asking for, with all of the same T-SQL commands / syntax as Express.
0
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 100 total points
ID: 40412315
If the application is very simple as you describe then SQLite may be all you need. There is more overhead in other suggestions (all of which are relevant though, I am late to the party it seems).

A disadvantage of SQLite is that isn't full T-SQL compatible and there are some restrictions (e.g. no RIGHT OUTER JOIN) that may not be familiar to you. It is very actively supported and extremely commonly used for the type of deployment you describe.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 42

Author Comment

by:Chris Stanyon
ID: 40412318
Thanks guys,

Very quick response and some good pointers. I'm going take a little time to read through the links you've provided and may be back with a follow up question or two.

Bear with me while I get my head around the various options.
0
 
LVL 24

Assisted Solution

by:mankowitz
mankowitz earned 100 total points
ID: 40412346
Although I like sqlite because it is compact, it is still one more thing to package into your application. Remember that if you are using .net, you can use datatables upon which you can execute most queries that you will need. If all you want to do is look up data for the user, this is the cleanest solution.

If the user will be updating the data, you will have to persist it between executions. For that, you could write an XML file (as in WriteXml("XMLFile.xml")) or you could simply add it to my.settings
0
 
LVL 42

Author Comment

by:Chris Stanyon
ID: 40414698
Thanks everyone. All excellent suggestions that give me enough options and plenty of reading  to do.

Initial thoughts are that a SQL Compact DB file seems ideal. Some of the development I do is also for handheld mobile devices running Windows CE, and it seems suited to that side of things as well - so one solution seems to cover both platforms.

SQLite also seems like a viable option for both platforms, so will definitely look into that. At the moment, the app I'm working on isn't particularly complex, so limitations in SQLite may not be a problem, although trying to guess the future and keep things scalable may play a part in my decision.

The SQL Server LocalDB seems to be a newer format introduced in later version of VS - I'm using 2008, so doesn't look like an option.

I did originally consider text files for the data (aka XML), and may still look at that as an option - be interesting to know how XML as a datasource performs against a 'traditional' database setup.

All valid responses, so I'm going to share the points evenly
0
 
LVL 42

Author Closing Comment

by:Chris Stanyon
ID: 40414702
EE does it again :)

Thanks everyone
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now