title: Modifying or replacing column values reading from the DataTable
body: <p>I am trying to update values in a column like the following code block reading from a datatable. Currently, it is only updating the specified column value (string) for the first row but not going through the next rows and updating those. What am I doing wrong? Please advice. </p>
  
  <pre><code>public void UpdateDescription(DataTable dataTable)
  {
      if (dataTable != null &amp;&amp; dataTable.Rows.Count &gt; 0)
      {
          DataRow dr = dataTable.Rows[0];
          string dataDesc = string.Empty;
          int rowIndex = 0;
          dataDesc = dr["DataDesc"].ToString();
  
          if (rowIndex &lt; dataTable.Rows.Count)
          {
              dr = dataTable.Rows[rowIndex];
  
              if (!dr.IsNull("DataDesc"))
              {
                  if (dataDesc.Contains("STATE"))
                  {
                      dataDesc = dataDesc.Replace("STATE", "").Trim();
                  }
  
                  if (dataDesc.Contains("HELLO ALL"))
                  {
                      dataDesc = dataDesc.Replace("HELLO ALL", "").Trim();
                  }
  
                  if (dataDesc.Contains("("))
                  {
                      dataDesc = dataDesc.Remove(dataDesc.IndexOf("(")).Trim();
                  }
              }
              dr["DataDesc"] = dataDesc;
          }
  
          rowIndex++;
  
      }
  }
  </code></pre>