title: How to set fields in DataRow object
body: <p>I have migrated legacy code from vb to c#. The following migrated line of code raises an error:</p>
  <pre><code>using System.Data;
  ..
  ..
  DataRow targetDataRow = targetDataTable.NewRow();
  targetDataRow.SetField(&quot;DateValue&quot;, calendarRow.DateValue.ToShortDateString);
  </code></pre>
  <p>The error:</p>
  <pre><code>=Error  CS1061  'DataRow' does not contain a definition for 'SetField' and no accessible extension method 'SetField' accepting a first argument of type 'DataRow' could be found (are you missing a using directive or an assembly reference?)
  </code></pre>
  <p>I know I can use it like:</p>
  <pre><code>targetDataRow[&quot;DateValue&quot;] = calendarRow.DateValue.ToShortDateString);
  </code></pre>
  <p>But, is this the best practice to set the value to a field in DataRow object?</p>