Creating and Saving Data to New Forms

dabeastro

Member
Joined
Jul 1, 2010
Messages
5
Programming Experience
Beginner
Hi. New to vb.net coming from vba. I am working on a mass balance model which collects a handful of 'user' data (less than 10 records) and then applies various equations to the data and records/reports the resulting values. I think I have a pretty good handle on the basic operators for a single 'user', having pretty extensive vba knowledge. However, I am having difficulty saving the new 'user' data and creating new 'users'. I need to keep the app as simple as possible for deployment to machines with nothing more than 2.0 and I do not really need a database, just a simple method of creating multiple 'users' as objects. I hope that makes sense. Thanks in advance for any help.
 
A user is a water user that has population, use per day, roof size, cost, etc. There will be other data (% increase of use and cost) that will apply to all users. This is a simulation model that runs over a 10-50 year period with daily reporting. I have been considering using either .txt files or Access .mdb to store and report figures. However, that may be overkill. I can use Access to get the data in, but it seems like a chore to call it all back out to apply math operators and then restore it in either the database or a text file.
 
I wouldn't use a text file. I'd probably go with XML if you wanted to avoid a database, or stick with a file-based database like Access or SQL Server CE. With an XML file, you can call the ReadXml method of a DataSet or DataTable to read in the whole lot. You can then manipulate the data in the DataTable(s) or transfer it to other objects if appropriate. Once you're done you can call WriteXml to save the lot. That may be easier if you want just one read operation and one write operation.

If accessing the data needs to be finer-grained than that then a database would be the way to go. ADO.NET is not that difficult and you could even use the Data Source wizard to generate a typed DataSet and the TableAdapters to retrieve and save the data. Pretty much the only code you'd need would be to call Fill and Update. The typed DataSet also gives you access to the data via strongly-type properties, rather then using the DataRow.Item property and string names.
 
Wow. Thank you so much. I guess I should have noted that I need to stay in 2.0 as this app will be freely distributed and it is anticipated that many end users will not be up to date. (govt. sector...)

It is my understanding that ADO.NET requires 3.5. Is that correct? Regardless, I am a fan of XML and I think that will work really well for this task which is really just a complicated calculator. I will post back soon to update my progress. Thanks again.
 
Back
Top