Results 1 to 3 of 3

Thread: checkbox does'nt work with ado.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    2

    Unhappy 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.

  2. #2
    Member
    Join Date
    Sep 2002
    Location
    Cincinnati, OH
    Posts
    44
    Don't use the wizard...... If you write the code, it should work fine.
    Jim Webster

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    2
    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
  •  



Click Here to Expand Forum to Full Width