c# 4.0 - How can I check, then change, the value in a datatable cell? -


I have a datatate, transformer, DT, which is populated with data from the database table. I would like to check the value in a particular cell (row 0, column 6), and change the value based on that value which I am getting. For example, if this value is "0002", then I want to change it to "Conventional". Basically, when I look at the screen I am trying to make the values ​​"human readable".

I am trying to do something like this:

  if (Transformer DT.RO [0] [6] == "0002") {Transformers DT. RO [0] [6] = "Conventional"; }    

You are closed:

  Transformer DT .RO [0] [6]. Ostring () == "0002") {Transformers DT. RO [0] [6] = "Conventional"; }   

You reference the row and column correctly, but you need to put the contents of the cell in the string before you run your comparison.

Comments