title: How to get Index in Datatable
body: <p>I need some help here, for example I have the following item in my datatable</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Column 1</th>
  <th>Column 2</th>
  <th>Column 3</th>
  <th>Column 4</th>
  <th>Column 5</th>
  <th>Column 6</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>RowX</td>
  <td>1</td>
  <td>12</td>
  <td>0</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>RowX</td>
  <td>2</td>
  <td>12</td>
  <td>0</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>RowX</td>
  <td>3</td>
  <td>12</td>
  <td>0</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>RowY</td>
  <td>3</td>
  <td>12</td>
  <td>1</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>RowY</td>
  <td>1</td>
  <td>12</td>
  <td>1</td>
  <td></td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>and I want to get the index of this row</p>
  <p>RowX  |   3  |  12  |   0   |         |</p>
  <p>because I want to update the Column 5 and Column 6 of this row. If I used the above query like</p>
  <pre><code>var index = from row in DataTable1.AsEnumerable()
  let r = row.Field&lt;string&gt;(&quot;Column1&quot;)
  let s = row.Field&lt;int&gt;(&quot;Column2&quot;)
  let t = row.Field&lt;string&gt;(&quot;Column3&quot;)
  let u = row.Field&lt;string&gt;(&quot;Column4&quot;)
  where r == DataRowX &amp;&amp; s == 12 &amp;&amp; t == 3 &amp;&amp; u == 0
  select DataTable1.Rows.IndexOf(row);
  
  DataTable1.Rows[index][&quot;Column5&quot;] = intUpdateValueColumnx;
  DataTable1.Rows[index][&quot;Column6&quot;] = intUpdateValueColumny;
  DataTable1.AcceptChanges();
  </code></pre>
  <p>This is not working because Argument 1: cannot convert from 'System.Data.EnumerableRowCollection' to 'int'. How to get the index?</p>
  <p>Is there another way to achieve this?</p>