Problem with DataTable.Rows.Select

T

Thomas

Hello

In my Application i detected a strange, unexplainable behavior
associated with DataSet and DataRow.

In my DataSet i want to Select all rows with OrderState 1:
DataRow[] rows = myDataSet.Tables["order"].Select("OrderState = 1");

Afterwards I write these orders to an XML to upload them to the
Server. Within 6 months of beeing productive and hunderts of orders it
happened 3 times that an order with OrderState 0 was uploaded.

I cannot find the cause of this behaviour. The only ideas I have are:
- The Select() method selected an wrong DataRow with OrderState 0
- The selected DataRow was correct but because of manipulating the
DataSet from a second Thread (UI) the Pointer/Index of the DataRow
changed and pointed to another Row with OrderState 0.

This code runs in a background thread and the DataSet is bound to UI-
Controls. The DataTable has a PrimaryKey-Column and NotNull-Constraint
on OrderState-Column.

Does anybody know how the internal relation between DataRow and
DataTable is relized? Is it possible that a DataRow points to an index
of the Table? So when I insert a new Row in the front, the DataRow
points to an other row?

Pleas tell me if you have an idea!

Thanks
Thomas
 

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