Question Saving/Loading application files - non-trivial

pcesarano

New member
Joined
Sep 14, 2011
Messages
2
Programming Experience
3-5
Hello all, hopefully someone has a recommendation that could help me, but I won't hold my breath...

So, I have created a VB 2010 project that works quite well and is also quite large (~9 forms, 15 datagridview objects not to mention hundreds of textboxes, checkboxes...you get the idea). The program ultimately just stores patient medical data on each form and then calls it/prints it out at the end to a (specially formatted) text file. End of story. My problem is that I would like to save/load these files (either in xml or some unique extension) so that JohnSmith.xml (or whatever) results in all forms being repopulated with whatever data they were saved as.

I attempted to find an answer online, but there seems to be lots of info on saving 'a' control, not a carte blanche "save all forms, data and control state" option--I probably don't have time to do this one by one.

Any help much appreciated! BTW, file size is not an issue--large, sloppy files that accomplish the task are A-OK.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,728
Location
Sydney, Australia
Programming Experience
10+
Your best bet would likely be to define a type or types that represents all the data for a single record. You can then use XML or binary serialization to save an entire object or object graph to a file and reload a file into an object or object graph. You can then bind that object to the controls in your application or else transfer the data manually at the points of load and save.
 
Top Bottom