title: No mapping exists from object type System.Web.UI.WebControls.GridViewRow to a known managed provider native type
body: <p>I want to make a gridview that when I select a row, its values will be populated to another gridview and text boxes, but I am encountering the error above. When I click the row in the GridView2, nothing is happening and an error in the sqladapter occurs. Please help me to fix this code..</p>
  
  <p>Here is my code:
  c#</p>
  
  <pre><code>protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
  {
      SqlConnection con = new SqlConnection(conn);
      SqlCommand com = new SqlCommand("SELECT MRPNo, MRPType, MRPDate FROM MRP WHERE MRPNo = @mrpno",con);
      com.Parameters.Add("@mrpno", GridView2.SelectedRow);
      DataTable dt = new DataTable();
      SqlDataAdapter sda = new SqlDataAdapter(com);
      sda.Fill(dt);
      DataRow row = dt.Rows[0];
      txtMRPNo.Text = row["MRPNo"].ToString();
      txtMRPDate.Text = row["MRPType"].ToString();
      txtMRPDate.Text = row["MRPDate"].ToString();
      GridView3.DataBind();
      GridView1.DataBind();
  }
  
  protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      LinkButton selectButton = new LinkButton()
      {
          CommandName = "Select",
          Text = e.Row.Cells[0].Text,
      };
      e.Row.Cells[0].Controls.Add(selectButton);
  }
  
  protected void GridView2_RowCreated(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
          {
              e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textDecoration='underline';";
              e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
              e.Row.ToolTip = "Click to select row";
              e.Row.Attributes["onclick"] = this.Page.ClientScript.GetPostBackClientHyperlink(this.GridView2, "Select$" + e.Row.RowIndex);
          }
      }
  }
  </code></pre>