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

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.