Hi all,
I want to modify the contents of a DataTable cell in a method. I assumed that just passing table.Rows[i]["Value"] would be enough. There is no passing by value in this case. I figured that this is actually a method returning a reference as result and as such I would be able to modify the cell contents.
This didn't work and I don't understand why. I tried passing a reference explicitly but that didn't work neither becasue you can not reference an indexer.
In the end I got something working but I got confused about references in this particular instance. This is how I got it working:
Thanks in advance for the clarification,Code:Object temp = table.Rows[i]["Value"]; CheckCellIntegrity(ref temp, table.Rows[i]["Type"].ToString(), i+1); table.Rows[i]["Value"] = temp;
Jef




Reply With Quote
