-3

It may seem easy but I cannot find the way: dt.Rows[r].Cells[c] does not work for DataTable.

This is what I have tried. I do not have other ideas.

halfer
  • 19,824
  • 17
  • 99
  • 186
user1238784
  • 2,250
  • 3
  • 22
  • 41

1 Answers1

0

dt.Rows[r] should return a DataRow assuming r is an int value between 0 and dt.Rows.Count-1 inclusive.

To get a specific cell value from a DataRow you use one of it's indexers, so you don't need the .Cells - you can just do dt.Rows[r][c] where c is either an int, a string or a DataColumn

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121