C# Saving list entries
Page 1 of 1
Rayne01




Posts: 39

PostPosted: Sun, 8th Jun 2014 19:42    Post subject: C# Saving list entries
Ok, another question; I have several classes:

Vehicle (base)
Motorbike (inherited)
Car (inherited)
Program (Handles the menu choices)
Execute (Hanlles input and list of Warehouses)
Warehouse (Contains a list of vehicles)

Once I enter an entry I want be able to save those entries to a file so I don't have to keep entering the same entries during error testing.

I've tried using StreamReader/Writer but as soon as I start without debugging, it crashes straight away and tells me the file is already in use.

I just want to know the syntax and where to put it so I don't have to constantly enter the same entries when i stop/close the program.

Thanks in advance.
Back to top
Guy_Incognito




Posts: 3435

PostPosted: Sun, 8th Jun 2014 20:00    Post subject:
Back to top
bloodian




Posts: 1026

PostPosted: Wed, 11th Jun 2014 14:28    Post subject:
A general rule of thumb I apply to is:

- Use app.config or create a config.xml (doesn't matter) for app settings (remembering filter choices, window sizes etc.) like this:

http://stackoverflow.com/questions/1186576/how-to-save-configuation-in-app-config-in-c-sharp-winforms

- Otherwise you use a database. SQLite is very easy to use.
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group