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

Posted on 2014-10-29
Last Modified: 2014-10-30

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.


Question by:Chris Stanyon

Accepted Solution

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

SQL Server Compact

or SQLite

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

Assisted Solution

chaau earned 100 total points
ID: 40412293
I would suggest you use SQLite. It has a 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.
LVL 22

Assisted Solution

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

Was designed to do pretty much what you're asking for, with all of the same T-SQL commands / syntax as Express.
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

LVL 48

Assisted Solution

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.
LVL 43

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.
LVL 24

Assisted Solution

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
LVL 43

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
LVL 43

Author Closing Comment

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

Thanks everyone

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What's wrong with this T-SQL Foreign Key? 7 51
T-SQL: New to using transactions 9 46
Database needed for HR files 4 56
Unlocking a column in excel using C# 17 15
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…

809 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