Click to See Complete Forum and Search --> : Problem with manual databinding


satanorz
February 18th, 2009, 04:03 PM
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.


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


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!

dglienna
February 18th, 2009, 10:32 PM
Set the binding to Nothing, and close the connection. Set the binding again, and open the connection