[.net] Saving Data in a C# app

Started by
6 comments, last by rfterdarc 17 years, 5 months ago
Is there any way to locally save data in/with my C# besides writing to a text files or creating a database and connecting to s SQL Server? I remember someone showing me an option in Visual C# but for the life of me I don't remember what it was. I've [google] and no luck there.

Beginner in Game Development?  Read here. And read here.

 

Advertisement
Do you mean Settings?

Do you mean a file in binary?

Serialization?

Registry (Win32 only)?
Ha! Settings was the option I was looking for. I'm not trying to write to a file (text or binary) and also I'm not trying to connect to a database (server). While teh Google, I looked at datasets. It seems I can (and of course tell me if I'm wrong or how horrible an idea this is if that's the case) open a dataset bind my field to them, save the values I put into those fields into the dataset and save them. Then the next time I open my app everything will populate and I can move on from there.

Is this proper? Or a no-no?

Beginner in Game Development?  Read here. And read here.

 

I'm really fond of Nini .NET Configuration Library. Has the ability to easily write to an INI file, the registry, .config, XML files, etc.
Rob Loach [Website] [Projects] [Contact]
Yeah, I usually use Settings - Pretty neat feature. Recently I started to use ini and xml files and this is exactly the library I was looking for, Thanks :)
Just to be clear, Settings was the feature that I couldn't remember. But basically I just want to have data for my app to load, alter, and save. I was wondering if there's was any other way to do this than writing/saving to file (binary or text) or having to connect to database/server.

It looks like I can do this with just datasets. Right or wrong? Proper or no-no?

Beginner in Game Development?  Read here. And read here.

 

AFAIK DataSets involve files too (when saving data for further use), so basically there is no way to store any kind of data without writing them somewhere - registry, files, etc.

Althoug there could be one solution - Try out something with System.Reflection. It provides access to Dynamic Code parsing e.t.c. I think its possible to code a program, that has an attached DataSet and a full program source, which compiles its self on the fly, then stays in memory and rewrites itself.. :P OK, this may sound unrealistic :)

You might find this useful then
XMLDocument :)

This topic is closed to new replies.

Advertisement