blah blah blah is here! blah blah » Close

up0down
link

I know I can connect to a mySql or SQL Server from my C# application but I think I am looking for something different.
I want to write a application that will be installed on people's PCs where I have no control over the setup of the system. This application needs to store information in a database or some sort of structure. Is there some internal database for a application that could be installed in the users application directory?
Im thinking of programs like Quickbooks for example do not use SQL as each company that you setup has all the data stored in different files.

last answered 2 years ago

1 answers

up0down
link

Could you simply create a class to store your object in and then create an array of those classes that you would save to a text file that would be modified when the program closes and read when it opens?
Or, perhaps a Microsoft Access file that is stored on the user's computer would be even better.

up0down
link

Well I am trying to create a application that will store reciepes... so i really need a database where i can reference items by ID numbers and everything else. It just seems like there has to be some other way to store data.

up0down
link

You apparently just want each user to have his own file for storing data instead of storing it on a shared server. You have several options.
You could embed a database. Each user could have his own Access database as already mentioned. Sql Server 2005 Express is also a free embeddable database (the 4 gigabyte limitation is a bit scary though). Sql Server is also a bit harder to embed - coding-wise - than the next option - SQLite (the .Net version). You can create a SQLite database in one line of code, but it will take a day or two of study to familiarize yourself with this database. It's very popular, although i must admit that another member, Clark, started a thread in the last few days about how he could not get it to install on a user's machine (don't know if he ever solved that one). Sqlite is free, it's fast, and there are no size limitations. (But it's not intended to be multi-user).
You could turn to serialiazation using the BinaryFormatter or the XML serializer.
Or, you could store the data in a datatable or dataset and then call the dataSet.WriteXml method to save the data.

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback