title: load data from sql server table and populate textboxes using dapper
body: <p>i pass selected ProductID as a string to retrieve data from row with the same ProductID</p>
  <pre><code>private void modifyButton_Click(object sender, EventArgs e)
      {
          if (productsTable.SelectedRows.Count &gt; 0)
          {
              int selectedrowindex = productsTable.SelectedCells[0].RowIndex;
              DataGridViewRow selectedRow = productsTable.Rows[selectedrowindex];
              string ProductID = Convert.ToString(selectedRow.Cells[&quot;ProductID&quot;].Value);
              
              ProductModel product = db.LoadProduct(ProductID);
          }
      }
  </code></pre>
  <p>then i try to load data and get it as a ProductModel to populate textboxes with it</p>
  <pre><code>public ProductModel LoadProduct(string productId)
      {
          ProductModel output;
  
          using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(CnnString(db)))
          {
              output = connection.Query
                  (@&quot;SELECT * FROM Products WHERE ProductID = @ProductID&quot;, new { ProductID = productId }).Single();
          }
  
          return output;
      }
  </code></pre>
  <p>i get error
  Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: &quot;Cannot implicitly convert type object to SalesManager.Models.ProductModel</p>
  <p>i tried before with a List and it seem to work, but then i dont know to to get objects and convert the to strings.</p>