2

A question like this has been asked differently several times. Yet here i am.

I am writing a standalone windows program which will get user input like three fields and have to store it in the disk.

Also i need to delete them, edit them and so on.

It should be UTF8.

Besides here is the actual need.

I have hosted this application in my server and users can download it.

I want the db automatically created when the program is executed for the first time.

What i mean is user can or should download only one file and that is the program.

The program will be one exe file and it will not have any dependencies.

meanwhile asking this question i tried sqllite for .net 2.0 and i got an installer from sourceforge and installed it.

I included in my application and it showed an error like there is a problem in that.

So, if people suggest sqlite then please give me reference of how to include in c#.net v2.0

I am new to .net so it is taking a very long time to fit things together so thought of posting this question.

any comments, suggestions, advices and references would do good.

EDIT

I have attached the error what i got

enter image description here

Edit after first reply

A user can save as many as set of three fields. I mentioned three fields for an example. They will save as many as records as they want. It could 100 to infinity.

Jayapal Chandran
  • 10,600
  • 14
  • 66
  • 91
  • SQLite works fine for me. I don't know why you're getting it from SourceForge: get it from the [System.Data.SQLite download page](http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki) at http://sqlite.org :) If you do settle on SQLite (it sounds like a prime candidate, although there are others) and still have problems, ask a *specific question* about those issues -- after searching, of course :) –  Dec 08 '11 at 07:49
  • If you want that error solved then better give some more details. – H H Dec 08 '11 at 07:51
  • i could see versions like 3.5 or 4.0 but i am using 2.0 .net2005 – Jayapal Chandran Dec 08 '11 at 07:52
  • Err... I don't use a VS package for SQLite. Is that an "extra"? All that's needed is the "System.Data.Sqlite.dll" and "sqlite3.dll" files -- just add a reference to the former in the project, and make sure the latter is in the load path. Then use ADO "like normal" :) –  Dec 08 '11 at 07:56

1 Answers1

2

If that's only 3 fields to store - forget about databases and store the data in an XML file.

You can create a class that has these 3 properties, and then serialize/deserialize it on demand.

Here's a nice tutorial from Microsoft about XML serialization: http://support.microsoft.com/kb/815813
Deserialization is done in a very similar fashion.

Svarog
  • 2,188
  • 15
  • 21
  • A user can save as many as set of three fields. I mentioned three fields for an example. They will save as many as records as they want. It could 100 to infinity. – Jayapal Chandran Dec 08 '11 at 09:28
  • and... i hate to use xml with .net because it is clustered so much with all the inheritances. I was thinking that xml would be so easy like in PHP. neither xml nor json in .net are as simple as PHP. I still wonder why it is so complicated to use xml in .net. i was hoping for a DOM traversal in .net – Jayapal Chandran Dec 08 '11 at 09:31
  • First - XML is really easy to use in .NET, just not the same way as in PHP. But it doesn't matter, with Xml Serialization you don't touch the XML itself, all is done for you. Instead, you manipulate objects. I suggest you read the link I've given you. – Svarog Dec 08 '11 at 10:38