Persisting Form Data

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi,

I am looking for an article or tutorial on persisting winform user input for
the life of the app. How to design it? For instance, do I create a
container class specific to each form? This data will need to be accessed
throughout the application and then be persisted to a xml file. Any ideas?

Thanks
 
Hi Tom,

Thanks for posting in this group.
This depends on the design of your application. Normally, all your controls
and elements will run in the main Form class, so you can create a public
field of Form class to store your input. And all the controls can get this
input data through this public field.
If your application is a MDI Form, I think you should also store input data
in Parent form's public field. When creating the child forms, you should
pass the parent form's reference to its child forms, then all the child
forms can manipulate this data.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks for the post. I understand I could use the forms as the container of
data however this data is used in Business Objects and then will be saved to
file and maybe in the future to a db. So, I rather not directly reference
the form to get the data so I am looking for a better way. Container
classes or typed datasets... and so on. Any ideas?

Thanks
 
Back
Top