title: Fit image from database to a DataGridView Cell
body: <p>I am developing a desktop application using a VS-2012 with VB.net.<br />
  Here is my code:</p>
  <pre><code>Dim constring As String = &quot;connection_string&quot;
  Using con As New SqlConnection(constring)
      Using cmd As New SqlCommand(&quot;SELECT * FROM tbl_product&quot;, con)
          cmd.CommandType = CommandType.Text
          Using sda As New SqlDataAdapter(cmd)
              Using ds As New DataSet()
                  sda.Fill(ds)
                  DataGridView1.DataSource = ds.Tables(0)
              End Using
          End Using
      End Using
  End Using
  </code></pre>
  <p>Image shows the current output:</p>
  <p><a href="https://i.stack.imgur.com/LWHOW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LWHOW.png" alt="enter image description here" /></a></p>
  <p>How can I display the image fit to the height and width of the Cell?<br />
  I changed the row height in design mode (<code>DataGridView -&gt; RowTemplate -&gt; Height</code>).<br />
  But, don't know how to fit the image to display it properly.</p>
  <p><a href="https://i.stack.imgur.com/0X9uC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0X9uC.png" alt="enter image description here" /></a></p>