Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Check Box Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JJ297 - 09 Aug 2007 15:08 GMT
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
Mark Fitzpatrick - 09 Aug 2007 15:17 GMT
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

>I need some assistance with a check box question.
>
[quoted text clipped - 28 lines]
>
> Thanks in advance
JJ297 - 09 Aug 2007 15:35 GMT
> 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
[quoted text clipped - 39 lines]
>
> - 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?
Ross Culver - 09 Aug 2007 20:37 GMT
Put code in your codebehind page checkbox1.checkedchanged event that changes
one checkbox based on the checked value of the other.

Ross

>> Is the database a boolean value? If so that Y or N is not what you would
>> see
[quoted text clipped - 50 lines]
> both will go into the database with Y and N answers how do I make the
> user select one check box at a time?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.