Skip to main content
gamedev.net
🔒 Locked

Saving WindowsForm Content

Started by Rixxe Mar 28, 2011 at 1:17 PM 0 replies 750+ views
Original Post
Rixxe
Rixxe
Afternoon all,

I've created a program which uses the medical data that my company owns, to allow 3rd party users to select specific records, codes, patients on a stand alone application.
The amount of choice is large, so i would like them to be able to save a 'query'. The form itself is made up of textboxes, checkboxes, listboxes etc.

I thought i might be able to save the content of the form within a text file, so either the text or something stating that a checkbox was enabled.
Then i could read it back in and updated the various controls, if the user requests the load.

However, the question is, is there a better way to do this? (Guess very much so) Or Would anyone like to give me some guidence into my suggestion?

Added note: This is supposed to become a web application at some point, so something that would be easily transferable to that is a plus.

Many thanks

Rixxe.

verp
verp
The way I chose to do something similar at work was to save the queries in a database, with each column corresponding to the contents of the fields on the screen. I saved text field contents as varchar data in some columns, and checkbox checked states as bit data in other columns.

I did it that way for several reasons. I could add yet more columns to the database table that stored these queries to save informaiton such as when the query was saved, how many times a query was executed, or to allow one user to access queries saved by another user. Additionally, storing the queries in the database allows the users to use them no matter what computer they are physically accessing.

I present the user with a dropdownlist of their saved queries. When they choose one, the individual saved query data is obtained and I set all the forms controls appropriately based on it. This approach probably makes sense also if you are planning on this becoming a web application. With data saved in the database, you will minimize the disruption to the users when you make the Forms to web transition (meaning, they won't lose all the queries they have saved).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.