Click here to Skip to main content
15,917,177 members
Home / Discussions / C#
   

C#

 
GeneralRe: Store multiple checkbox values in a single field in database Pin
Mycroft Holmes5-Aug-09 23:19
professionalMycroft Holmes5-Aug-09 23:19 
GeneralRe: Store multiple checkbox values in a single field in database Pin
Pete O'Hanlon6-Aug-09 0:28
mvePete O'Hanlon6-Aug-09 0:28 
AnswerRe: Store multiple checkbox values in a single field in database Pin
JollyMansArt5-Aug-09 21:14
JollyMansArt5-Aug-09 21:14 
GeneralRe: Store multiple checkbox values in a single field in database Pin
Greg Chelstowski5-Aug-09 21:19
Greg Chelstowski5-Aug-09 21:19 
GeneralRe: Store multiple checkbox values in a single field in database Pin
JollyMansArt5-Aug-09 21:23
JollyMansArt5-Aug-09 21:23 
GeneralRe: Store multiple checkbox values in a single field in database Pin
Mycroft Holmes5-Aug-09 21:20
professionalMycroft Holmes5-Aug-09 21:20 
AnswerRe: Store multiple checkbox values in a single field in database Pin
Greg Chelstowski5-Aug-09 21:18
Greg Chelstowski5-Aug-09 21:18 
AnswerRe: Store multiple checkbox values in a single field in database Pin
Adam Jasper5-Aug-09 23:49
Adam Jasper5-Aug-09 23:49 
I have done this in the past and I don't see anything wrong with it provided the data values are directly related to one another.
[Serializable(), Flags()]
public enum DayBitFlag
{
    None = 0,
    Sunday = 1,
    Monday = 2,
    Tuesday = 4,
    Wednesday = 8,
    Thursday = 16,
    Friday = 32,
    Saturday = 64
}

Then create a class that inherits CheckBox, something like this:
public class DayCheckBox : CheckBox
{
    private DayBitFlag _dayValue;

    public DayBitFlag DayValue
    {
        get { return _dayValue; }
        set { _dayValue = value; }
    }
}

I am sure you can work the rest out from here.

Adam
GeneralRe: Store multiple checkbox values in a single field in database Pin
elci6-Aug-09 0:12
elci6-Aug-09 0:12 
QuestionNeed help retreiving the image from the database... Pin
JollyMansArt5-Aug-09 20:53
JollyMansArt5-Aug-09 20:53 
AnswerRe: Need help retreiving the image from the database... Pin
Henry Minute6-Aug-09 2:46
Henry Minute6-Aug-09 2:46 
QuestionCrystal Report Formula Pin
mjawadkhatri5-Aug-09 19:25
mjawadkhatri5-Aug-09 19:25 
AnswerRe: Crystal Report Formula Pin
JollyMansArt5-Aug-09 19:36
JollyMansArt5-Aug-09 19:36 
GeneralRe: Crystal Report Formula Pin
mjawadkhatri5-Aug-09 22:23
mjawadkhatri5-Aug-09 22:23 
GeneralVoice file conversion Pin
Pandu4385-Aug-09 18:28
Pandu4385-Aug-09 18:28 
QuestionDelimeters to split strings Pin
gamer11275-Aug-09 18:19
gamer11275-Aug-09 18:19 
AnswerRe: Delimeters to split strings Pin
dan!sh 5-Aug-09 18:27
professional dan!sh 5-Aug-09 18:27 
GeneralRe: Delimeters to split strings Pin
gamer11276-Aug-09 0:11
gamer11276-Aug-09 0:11 
AnswerRe: Delimeters to split strings Pin
Luc Pattyn5-Aug-09 23:50
sitebuilderLuc Pattyn5-Aug-09 23:50 
GeneralRe: Delimeters to split strings Pin
gamer11276-Aug-09 0:47
gamer11276-Aug-09 0:47 
GeneralRe: Delimeters to split strings Pin
Luc Pattyn6-Aug-09 0:53
sitebuilderLuc Pattyn6-Aug-09 0:53 
GeneralRe: Delimeters to split strings Pin
gamer11276-Aug-09 1:07
gamer11276-Aug-09 1:07 
AnswerRe: Delimeters to split strings Pin
Luc Pattyn6-Aug-09 1:14
sitebuilderLuc Pattyn6-Aug-09 1:14 
GeneralRe: Delimeters to split strings Pin
gamer11276-Aug-09 1:31
gamer11276-Aug-09 1:31 
GeneralRe: Delimeters to split strings Pin
Luc Pattyn6-Aug-09 1:42
sitebuilderLuc Pattyn6-Aug-09 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.