|
-
Oct 18th, 2002, 06:51 PM
#1
Thread Starter
New Member
checkbox does'nt work with ado.net
I have a db made in access (access 2000 format) and i'm using vb.net and ado.net to work with it (jet 4.0). I have all the controls on the form binded to the dataset, including two checkboxes that are binded to two yes/no fields in the db. I am doing all this with code.
The problem is adding a new row. I did this:
Me.BindingContext(Dataset, "field").AddNew()
The number of rows get's bigger but i can't access the new row. I've played with the dataform wizard, and I get the same problem. I've found out that if you don't bind the checkboxes to the dataset it works fine. Is there a bug I haven't heard of? It can't be my fault. The wizard does everything on it's own. Any help would be apreciated.
-
Oct 23rd, 2002, 08:09 AM
#2
Member
Don't use the wizard...... If you write the code, it should work fine.
-
Oct 23rd, 2002, 06:00 PM
#3
Thread Starter
New Member
I get the same problem. Let me try to explain a little better.
I have a datagrid, a few textboxes, some comboboxes and two checkboxes.
I also have a dataset with the table inside.
I bind the datagrid:
DataGrid.SetDataBinding(Ds, "Jogos")
then the textboxes:
TxtNome.DataBindings.Add(New Binding("text", Ds, "Jogos.Nome"))
...
and the checkboxes:
ChkExp.DataBindings.Add(New Binding("Checked", Ds, "Jogos.Expansão"))
...
Now, to add a new row I do:
Me.BindingContext(Ds, "Jogos").EndCurrentEdit()
Me.BindingContext(Ds, "Jogos").AddNew()
And here is where i get the problem. I already have some rows on the database, that i inputed with access, and when i add the row it does not go there. The datagrid gets a new row with null values but i cant select it there either. If i comment the binding of the checkboxes it works fine. It's really weird.
If it helps, I'm using WinXp with sp1 installed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|