Binding problem

  • Thread starter Thread starter touf
  • Start date Start date
T

touf

Hi,
In a local application, I have a form that contains some controls bound to a
datatable (of a dataset).
My problem is that the binding is lost sometime, my datatable contains 1 row
but I don't see any information in the controls, however if I save
(dataadpter.update(dataset)), and reopen the form I can see the information.
this is hapenning when I create a new row, then clear the datatable then add
this new row...
I've found this problem today, it was working fine before??!!!

Any idea about the cause of this problem?
thanks.
 
Clear the datatable jumps out at me. Why are you doing this? Unless you
are doing this after the update, prior to the Merge to make sure you client
datatable matches your datasource table.
 
Here is my code, what is wrong, I've tried clear and delete (line 1 and 2),
but still have the problem
'dataset1.Tables("client").Clear()

dataset1.Tables("client").Rows(0).Delete()

dataset1.Tables("client").AcceptChanges()

dataset1.Tables("client").Rows.Add(myRow)

I need to delete the unique existing row and replace it by the new one
 
Delete only marks the DataRow for Deletion. This is so you can call Update
later on. Remove or Remove will permanently delete the DataRow.
 
Back
Top