Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store data in a .net windows application

What would be the best way to store data in a windows forms application?

I started a project using SQL with a local .mdf file, but then soon realized that when I create an installer, and install on another system. I get an error saying SQL Server not found, because that server doesn't have SQL installed.

The target system that this app will be installed on will not have SQL installed.

So my question is: What is the norm? How is data usually stored and accessed in windows forms applications? Is it really a .mdf SQL database, or some type of sqlite DB?

If I can use a SQL database (mdf file) of some sort, without having to install SQL server on each client machine as well. How would I go about doing that?

Thanks!

like image 820
tcarter2005 Avatar asked Mar 15 '12 18:03

tcarter2005


People also ask

What is data binding C#?

Data binding is the process that establishes a connection between the app UI and the data it displays. If the binding has the correct settings and the data provides the proper notifications, when the data changes its value, the elements that are bound to the data reflect changes automatically.


2 Answers

There is now SQL Server Compact Edition. This is compiled right into your application. The end user won't need any other version of SQL Sever to use your application. See http://www.microsoft.com/sqlserver/en/us/editions/compact.aspx

like image 161
Carl Raymond Avatar answered Sep 28 '22 00:09

Carl Raymond


You should be using an embedded database then. SQL Server Compact Edition is an embedded database. This wikipedia link points to other embedded databases:

http://en.wikipedia.org/wiki/Embedded_database

Note that not all are free.

like image 24
code4life Avatar answered Sep 27 '22 23:09

code4life