CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Location
    Spain!
    Posts
    149

    Unhappy Problem with manual databinding

    Hi all!, he're we are with a strange problem.

    Using VB.NET 2005 on Access through OleDB components.

    I've a textbox in a custom control, that i need to be sync with a field on datatable, so i've added that piece of code.

    Code:
            Me.ImagenArticulo.TxFichero.DataBindings.Add("Text", DatosDS, "Articulos.Imagen")
    Then i edit the field, and save, and all is ok, the data has been changed on database.

    But, now, there's the problem.. in the process after that, i'm doing

    Code:
    DatosDS.Clear()
    The textbox is linked so, it's normal to be empty at this stage.

    The real problem came when i refill the dataset and the textbox remains empty.

    I've checked that the Databinding is still added, and all the data loaded shows fine in the other controls binded in design.

    I'm very confused at this point, and any help will be appreciated.

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Problem with manual databinding

    Set the binding to Nothing, and close the connection. Set the binding again, and open the connection
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured