title: Unable to cast object of type 'System.Data.DataRowView' to type 'System.Data.DataRow'
body: <p>I will post an answer to an error I had since I found the solution.</p>
  
  <p>I received the error in asp.net: Unable to cast object of type 'System.Data.DataRowView' to type 'System.Data.DataRow'</p>
  
  <pre><code>// Old line
  // rpOutils.DataSource = ds.Tables[0].Select("rnco_lang = '" + ddlLang.SelectedValue + "'");
  // rpOutils.DataSource = ds; // New line that caused the error. I just wanted to pass a DataSet
  rpOutils.DataSource = ds.Tables[0].Select(); // New line with the solution.
  rpOutils.DataBind();
  
  protected void rpOutils_ItemDataBound(object sender, RepeaterItemEventArgs e)
          {
              if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
              {
                  DataRow row = (DataRow)e.Item.DataItem; // I received the System.InvalidCastException
  </code></pre>
  
  <p>...</p>
  
  <p>The Dataset returned a DataRowView and the line that caused the problem expected a DataRow.</p>
  
  <p>I searched for the solution and didn't find, so I found it and posted my solution. Thanks.</p>