views:

62

answers:

1

I have an ASP.NET WebForm with a number of DropDownLists, multiple select enabled ListBoxes, CheckBoxes and TextBoxes.

What I would like to be able to do is allow the user to save all the selected options and call it a name as a saved report. This would then allow them to click to retrieve the selections they made when they come back to the page at a later date.

What would be the best way of saving the options in a database that will allow me to easily populate the report that the user has saved?

If you need more clarification of what I am trying to do then leave me a comment and I will try to give you what you ask for. At the minute this is as much as I have myself to go on.

+1  A: 

Maybe assign a uniqueidentifier to the Report in a table called Reports, and store the options from the DropDownLists in columns in this table.

For the multiple-select items, if you know what options they can choose, store each of those options as boolean in columns in this first table.

If you do not know what options they can choose, you may need to store the options selected in a separate table, associated to the ReportID.

So, the first option may look like this:

ReportID  ReportName  Option1  Option2  MultiSelectOption1  MultiSelectOption2 etc.

And the second option could look like this:

Table Reports

ReportID ReportName Option1 Option2

Table ReportOptions

ReportID OptionID
Matthew Jones
I think for a situation like this, a child table with a single field is overkill. Just create a text field in the Reports table and stuff it with the comma (or whatever) delimited values of the selected options.
David