Problem binding to CheckBox

R

Rodney Lane

Hi,

I am using an oledb data adapter to connect to an MSAccess 2003 database. I
use bindings on my windows forms to bind fields to the controls and for text
boxes and grids it has been fine.

I am having problems with binding to a check box. It works fine until I
attempt to add a new record to the dataset through the binding context
object.

The code that adds the new record to the dataset is listed below
Me.BindingContext(dsDataSet, TableName).EndCurrentEdit()

Me.BindingContext(dsDataSet, TableName).AddNew()

The add new statement generates the following error :

"DataBinding could not find a row in the list that is suitable for all
bindings"

If I remove the check box from the data binding - I can add the record ok.
The field it is binding to in the database is a Yes/No field.

Any help or insight will be much appreciated.

Cheers

Rodney Lane
 
M

Menu Chen

I see....
I thinks checkbox is not suitable for database binding,
althrouhg microsoft have promised that all the controls
can binding to database.
But ,you can try to do like this:before you want to add a
new record to the database,remove the checkbox from data
binding .And after you have succeed in Updating the
database,move the checkbox in again.I think it may be
works.
Sorry for my poor English.
Best Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top