I am using asp.net and I am trying to save checkbox values into a database. Multiple checkboxes may be entered into the same field in the database. So for instance I have two checkboxes with names ‘Comma’ and ‘Hyphen’ and if the user checks both of these then the database will store the values ‘,’,’-‘. How do you do this?
thanks
To save multiple values into the same column I’d recommend using a flag enumeration. Here is a code sample using checkboxes.
If you really have to store the values in a comma-delimited format, might try something like this: