I'm sure it's trivial but it's been a long day.
I have a DataTable in which one row has an empty cell. I want to find the row that has the empty cell, and simply assign a string to that cells value.
However when I step through the code during debug, the value never gets plugged into the table. What am I doing wrong???
currentTime = DateTime.Now.ToString();
for (int i = 0; i < OwnersTable.Rows.Count; i++)
if (OwnersTable.Rows[i].ItemArray[9].ToString() == "")
OwnersTable.Rows[i].ItemArray[9] = currentTime;
I found to accomplish this I had to create an entirely new row, copy every cell's contents of the existing row over, and then add it back to the table.
What???
Why didn't the simple cell assignment work in the code above????