Calling Clear() on empty dataset produces strange behavior.

  • Thread starter Thread starter jan
  • Start date Start date
J

jan

I have the following situation which I use often, but now produces strange
behavior:

- I have a class derived from a typed dataset.
- In this class I defined a method Read for reading data from a web service.
- As the Read() function can be called often, I first clear the dataset with
Clear()
- Then I merge the dataset returned from the web service with the cleared
dataset.

Now the first row of the merged dataset has disappeared, instead the second
appears twice, causing a constraint violation.

When I call the Read() method a second time and thus clearing a non-empty
dataset, all goes well.

Anyone has seen this before?

Patrick
 
I read something a while back about calling Clear twice in some instances.
Do some research on it. HTH.

Kevin
 
Back
Top