Solved

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

Posted on 2014-10-29
8
183 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 25

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 23

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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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

Author Closing Comment

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

Thanks everyone
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

749 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