Binding problem

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

Greg

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

touf

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
 
G

Greg

Delete only marks the DataRow for Deletion. This is so you can call Update
later on. Remove or Remove will permanently delete the DataRow.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top