|
|
|
start date: Thu, 09 Aug 2007 07:08:57 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
JJ297
|
|
2
Mark Fitzpatrick
|
|
3
JJ297
|
|
4
Ross Culver
|
Check Box Question
I need some assistance with a check box question.
I have two check boxes on a page:
<asp:CheckBox ID="ChkYes" runat="server" Text="Yes" /
> <asp:CheckBox
ID="ChkNo" runat="server" Text="No" />
This is under button_Click
My two fields in the databse
Dim displayedQues As Boolean = True
Dim nonDisplayedQues As Boolean = True
ChkYes.Text = "Y"
ChkNo.Text = "N"
If (ChkYes.Checked) Then
displayedQues = True
End If
If (ChkNo.Checked) Then
nonDisplayedQues = True
End If
It's going into the database now but I'm able to select both options
on the other page and when it goes into the database the values are 1
and 0 instead of Y and N.
What am I doing wrong?
Thanks in advance
Date:Thu, 09 Aug 2007 07:08:57 -0700
Author:
|
Re: Check Box Question
Is the database a boolean value? If so that Y or N is not what you would see
in a database. Booleans typically use bits, 1 for True, 0 for False. Saves a
lot of space in the database. Not sure what you mean about selecting both
options on the other page.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"JJ297" wrote in message
news:1186668537.652578.107990@r34g2000hsd.googlegroups.com...
>I need some assistance with a check box question.
>
> I have two check boxes on a page:
>
> <asp:CheckBox ID="ChkYes" runat="server" Text="Yes" /
>> <asp:CheckBox
> ID="ChkNo" runat="server" Text="No" />
>
>
> This is under button_Click
>
> My two fields in the databse
> Dim displayedQues As Boolean = True
> Dim nonDisplayedQues As Boolean = True
>
> ChkYes.Text = "Y"
> ChkNo.Text = "N"
>
> If (ChkYes.Checked) Then
> displayedQues = True
> End If
>
> If (ChkNo.Checked) Then
> nonDisplayedQues = True
> End If
>
> It's going into the database now but I'm able to select both options
> on the other page and when it goes into the database the values are 1
> and 0 instead of Y and N.
>
> What am I doing wrong?
>
> Thanks in advance
>
Date:Thu, 9 Aug 2007 09:17:24 -0500
Author:
|
Re: Check Box Question
On Aug 9, 10:17 am, "Mark Fitzpatrick" wrote:
> Is the database a boolean value? If so that Y or N is not what you would see
> in a database. Booleans typically use bits, 1 for True, 0 for False. Saves a
> lot of space in the database. Not sure what you mean about selecting both
> options on the other page.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "JJ297" wrote in message
>
> news:1186668537.652578.107990@r34g2000hsd.googlegroups.com...
>
>
>
> >I need some assistance with a check box question.
>
> > I have two check boxes on a page:
>
> > <asp:CheckBox ID="ChkYes" runat="server" Text="Yes" /
> >> <asp:CheckBox
> > ID="ChkNo" runat="server" Text="No" />
>
> > This is under button_Click
>
> > My two fields in the databse
> > Dim displayedQues As Boolean = True
> > Dim nonDisplayedQues As Boolean = True
>
> > ChkYes.Text = "Y"
> > ChkNo.Text = "N"
>
> > If (ChkYes.Checked) Then
> > displayedQues = True
> > End If
>
> > If (ChkNo.Checked) Then
> > nonDisplayedQues = True
> > End If
>
> > It's going into the database now but I'm able to select both options
> > on the other page and when it goes into the database the values are 1
> > and 0 instead of Y and N.
>
> > What am I doing wrong?
>
> > Thanks in advance- Hide quoted text -
>
> - Show quoted text -
Thanks Mark,
In the database I have it listed as Char. I changed it and now it's
working properly.
On the design page I can select the both boxes yes and no and they
both will go into the database with Y and N answers how do I make the
user select one check box at a time?
Date:Thu, 09 Aug 2007 07:35:06 -0700
Author:
|
Re: Check Box Question
Put code in your codebehind page checkbox1.checkedchanged event that changes
one checkbox based on the checked value of the other.
Ross
"JJ297" wrote in message
news:1186670106.803924.104490@b79g2000hse.googlegroups.com...
> On Aug 9, 10:17 am, "Mark Fitzpatrick" wrote:
>> Is the database a boolean value? If so that Y or N is not what you would
>> see
>> in a database. Booleans typically use bits, 1 for True, 0 for False.
>> Saves a
>> lot of space in the database. Not sure what you mean about selecting both
>> options on the other page.
>>
>> Hope this helps,
>> Mark Fitzpatrick
>> Microsoft MVP - FrontPage
>>
>> "JJ297" wrote in message
>>
>> news:1186668537.652578.107990@r34g2000hsd.googlegroups.com...
>>
>>
>>
>> >I need some assistance with a check box question.
>>
>> > I have two check boxes on a page:
>>
>> > <asp:CheckBox ID="ChkYes" runat="server" Text="Yes" /
>> >> <asp:CheckBox
>> > ID="ChkNo" runat="server" Text="No" />
>>
>> > This is under button_Click
>>
>> > My two fields in the databse
>> > Dim displayedQues As Boolean = True
>> > Dim nonDisplayedQues As Boolean = True
>>
>> > ChkYes.Text = "Y"
>> > ChkNo.Text = "N"
>>
>> > If (ChkYes.Checked) Then
>> > displayedQues = True
>> > End If
>>
>> > If (ChkNo.Checked) Then
>> > nonDisplayedQues = True
>> > End If
>>
>> > It's going into the database now but I'm able to select both options
>> > on the other page and when it goes into the database the values are 1
>> > and 0 instead of Y and N.
>>
>> > What am I doing wrong?
>>
>> > Thanks in advance- Hide quoted text -
>>
>> - Show quoted text -
>
> Thanks Mark,
>
> In the database I have it listed as Char. I changed it and now it's
> working properly.
>
> On the design page I can select the both boxes yes and no and they
> both will go into the database with Y and N answers how do I make the
> user select one check box at a time?
>
Date:Thu, 9 Aug 2007 14:37:09 -0500
Author:
|
|
|