473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to bind a radio button to a SQL bit field or what data type to use for gender of a person in an SQL table

Neo
I put a similar post for CheckBoxes,
but i want to use a Radio button & not a CheckBox

I have a field named "Male" & this is of SQL BIT data type (SQL Server).
How can i bind this field to a check box?

I noticed that this field can be NULL, 0 or 1.
But i'm having trouble binding this field to my check box.

i get an error when i try the following,

'oDataTable is the Data Table with the relevant record & having the field
"Male"
RadionButton.DataBindings.Add("Checked", oDataTable, "Male")

I have 2 radio buttons, both put into a panel (so that only one can be
checked at a time).
& for the data binding, i am binding ONLY one radio button to the data
field.

Else, whats the best way to store the gender of a person - what should the
data type of the field be?


Nov 21 '05 #1
2 7951
Hi,

Maybe this will help.
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Ken
-----------------------
"Neo" <ne*@learning.net> wrote in message
news:uT**************@tk2msftngp13.phx.gbl...
I put a similar post for CheckBoxes,
but i want to use a Radio button & not a CheckBox

I have a field named "Male" & this is of SQL BIT data type (SQL Server).
How can i bind this field to a check box?

I noticed that this field can be NULL, 0 or 1.
But i'm having trouble binding this field to my check box.

i get an error when i try the following,

'oDataTable is the Data Table with the relevant record & having the field
"Male"
RadionButton.DataBindings.Add("Checked", oDataTable, "Male")

I have 2 radio buttons, both put into a panel (so that only one can be
checked at a time).
& for the data binding, i am binding ONLY one radio button to the data
field.

Else, whats the best way to store the gender of a person - what should the
data type of the field be?

Nov 21 '05 #2
Neo,

A radiobutton is a state: something is a man or a woman.
When it is not a man than it is a woman in your case.

So the radiobutton should work with binding when you have only one
datafield. The field tells Male = true, than Woman = false. To find the
rigth text with that is always a problem because one of those genders feels
them often discriminated.

When you don't want that, than you can try the binding events

http://msdn.microsoft.com/library/de...ventsTopic.asp

The samples are at the individual events

I hope this helps?

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Albanese | last post by:
I am developing an application to handle my compay's OSHA reporting requirements. Some of the input criteria are technical and narowly defined, so I was trying to prvide what i call "Context...
3
by: Karl | last post by:
Hi experts, In my application, I have a employee table containing a gender field which has value "M", "F". I bind gender field to the "checked" property of a group of 2 radio buttons. I hope to...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
1
by: Neo | last post by:
I have a field named "Male" & this is of SQL BIT data type (SQL Server). How can i bind this field to a check box? I noticed that this field can be NULL, 0 or 1. But i'm having trouble binding...
6
by: Shelly | last post by:
I have used radio buttons often in the past, but now I am having problems. Please, someone, look at this simple code and tell me where I am going wrong. I cannot retrieve the posted value of...
6
by: elia | last post by:
Hello. Yes, already ask but no answers for this little problem. I've got a form and 3 steps or page for the same form. If we come back to the first page, the states of button radio are lost. ...
5
by: elia | last post by:
Hello, I use php and javascript on a form. My validate script doesn't work with radio button. What's wrong? I want to be sure that one of the button is press. M or F I get on my first page: ...
1
by: runway27 | last post by:
hi i have registration form where user selects from a drop down to select their area code apart from filling other details in the form. in the next page which is a confirmation page i would like...
3
by: ToddFur | last post by:
I see several postings on this but I am still unable to figure out my problem. I can pass the values of my text field but not radio button (or even checkboxes). My PHP file <?php //declare...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.