I'm using .net 3.5 datatable and add rows to a datatable from more than one thread. when not usin lock I get mismatch between the datatablr rows count and the maximum index. When trying to serialize the table i get an exception there is no rows at poitions X. of course I can lock the datatable but I would like to know what is the cause. I would expect the row.count() method to return base on the row maxmimum index +1 and not the have a non independed counter. also, where can I find the internal implementation of rows.Add (params) method? it seems like the counter goes up per adding even if in soem cases the adding is on the same row.
Edit: thanks for the comments. I do know it is not thread safe for write and already solve it by using lock on the syncroot object. I would like to see what happen internally in the add method to see where the count get messed up.