Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Forms Application Database

Is it possible to have a build-in database in a windows forms application? I know you can connect to a database to the 'outside', but you require an internet connection for that. I pretty much just want to have a database that is accessible without internet

Anyone know how to do this?

like image 333
wesley221 Avatar asked Sep 11 '26 21:09

wesley221


2 Answers

There are a number of databases you can use. I'm not sure why you think accessing a database requires internet access. Here are some databases that you can use that don't require internet access. The only ones I can think of that require internet access are cloud based databases like SQL Azure (and they are more designed to be used from an application that is also running in the cloud)

  • SQL Server
  • SQL Server Express (also has some sort of file mode)
  • SQL Server Compact (has some limitations I didn't expect over regular SQL Server like no schema support. EDIT: but no longer supported)
  • SQLite (file based)
  • Vista DB (strong compatibility with SQL Server)
  • MySQL
  • Oracle
  • RavenDB

I suspect that if you want it "built in" to your application then something along the lines of VistaDB or SQLite may be more to your liking as they only require the addition of the relevant assemblies and database file for your application to be able to use the database.

like image 97
Colin Mackay Avatar answered Sep 14 '26 10:09

Colin Mackay


I would recommend you use SQLite as it is very lightweight and can be embedded in almost any application. By the way, it is the default database engine for Android applications.

The easiest way to use it is through ServiceStack OrmLite. It is a free ORM (v3 only, v4 is not). You can get it from NuGet using the following command in the package manager console:

PM> Install-Package ServiceStack.OrmLite.Sqlite32 -Version 3.9.71

like image 35
Moslem Ben Dhaou Avatar answered Sep 14 '26 09:09

Moslem Ben Dhaou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!