title: Error "Cannot implicitly convert type 'System.Data.DataRow' to..." when trying to pass the first DataRow of a table
body: <p>I have a DataSet created in VS 2017 DS designer and I am trying to retrieve the first row returned from the DataAdapter. When I  try to pass the first row <code>([TblEventTypes.Rows[0])</code> in TypesRow I get the error</p>
  <blockquote>
  <p>&quot;Cannot implicitly convert type 'System.Data.DataRow' to
  'DSEventTypes.EventTypesRow'. An explicit conversion exists (are you
  missing a cast)?&quot;</p>
  </blockquote>
  <p>Here is the code I have:</p>
  <pre class="lang-cs prettyprint-override"><code>private DSEventTypesTableAdapters.EventTypesTableAdapter _EventTypesDataAdapter;
  protected DSEventTypesTableAdapters.EventTypesTableAdapter EventTypesAdapter
  {
      get
      {
          if (_EventTypesDataAdapter == null)
          {
              _EventTypesDataAdapter = new DSEventTypesTableAdapters.EventTypesTableAdapter();
          }
          return _EventTypesDataAdapter;
      }
  }
  public bool GetEventTypeByID(int EventTypeID, ref string EventType, ref string Results)
  {
      DSEventTypes.EventTypesRow TypesRow;
      DSEventTypes.EventTypesDataTable TblEventTypes = EventTypesAdapter.GetDataById(EventTypeID);
      if (TblEventTypes.Rows.Count &gt; 0)
      {
          TypesRow = TblEventTypes.Rows[0];
      }
      return true;
  }
  </code></pre>
  <p>The error appears in the line <code>TypesRow = TblEventTypes.Rows[0];</code> and the red error line appears under <code>TblEventTypes.Rows[0];</code>. The declaration of &quot;TypesRow&quot; is correct as the VS 2017 intellisense does list all the column names in the table.</p>
  <p>I am new to C# (years ago used C++) and for many years I have been creating my Windows and Web applications is VB.NET so I am probably missing something simple and I would appreciate all the help I can get.</p>