| | |
binding radio buttons
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2005
Posts: 2
Reputation:
Solved Threads: 0
I'm trying to bind a radio button's checked property to an Access field defined as Yes/No and am having no success. I can programmatically read the dataset field and set the radio button, but I than have difficulty adding a new record and setting the dataset field to be updated in the dataset.
When I set the binding in the Property box for the radButton.checked to the Access dataset field, I cannot add/update/delete any records.
Is there something special about radio buttons that they don't bind the same as other controls? Should I be binding a different property than the checked property?
Michael
When I set the binding in the Property box for the radButton.checked to the Access dataset field, I cannot add/update/delete any records.
Is there something special about radio buttons that they don't bind the same as other controls? Should I be binding a different property than the checked property?
Michael
•
•
Join Date: May 2005
Posts: 2
Reputation:
Solved Threads: 0
From Advanced Programming Using Visual Basic.NET by Bradley and Millspaugh, 2003 p. 170
The Binding Bug
A big bug exists in the first release of ADO.NET: The AddNew method fails to clear all bound controls if a boolean field that is bound to a check box does not have a default value. For more information, see the Microsoft Knowledge Base article #Q321504. The article explains two ways to work around the bug: (1) change the field in the database to have a default value or (2) change the dataset schema in the application to assign a default value to the field.
The Binding Bug
A big bug exists in the first release of ADO.NET: The AddNew method fails to clear all bound controls if a boolean field that is bound to a check box does not have a default value. For more information, see the Microsoft Knowledge Base article #Q321504. The article explains two ways to work around the bug: (1) change the field in the database to have a default value or (2) change the dataset schema in the application to assign a default value to the field.
Reply to "The Binding Bug"
The question was in regard to a radio button. I have been unable to find a way to bind groups of radio buttons to a database field. If there is a way, I'd sure like to know what it is. Checkboxes are easy, because they are two-state (mainly) controls, but a set of radio buttons can have several choices, and I don't know of a database field type that can deal with that from a binding standpoint. I'm sure there must be at least some workaround that provides the needed functionality, but as I am a very inexperienced programmer, I couldn't provide anything effecient, or that would work at all.
The question was in regard to a radio button. I have been unable to find a way to bind groups of radio buttons to a database field. If there is a way, I'd sure like to know what it is. Checkboxes are easy, because they are two-state (mainly) controls, but a set of radio buttons can have several choices, and I don't know of a database field type that can deal with that from a binding standpoint. I'm sure there must be at least some workaround that provides the needed functionality, but as I am a very inexperienced programmer, I couldn't provide anything effecient, or that would work at all.
:!: In The Beginning, God; In The End, God. In between, believe whatever you like. :)
![]() |
Similar Threads
- javascript radio buttons and insanity (JavaScript / DHTML / AJAX)
- dynamically generated textboxes & radio buttons php, insert into db (PHP)
- javascript: radio buttons (JavaScript / DHTML / AJAX)
- IE6 - dialogue boxes , check boxes and radio buttons work very slowly after hijacking (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: Problems with a launch condition in vb.net Application
- Next Thread: Help, record arrays
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function html images input lib listview map mobile module msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net serial settings shutdown socket sorting sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode xml year





