title: Display image from Database on WPF DataGrid
body: <p>I want to display images in a <code>DataGrid</code> from the database and I am using WPF </p>
  
  <p>[<img src="https://i.stack.imgur.com/bM0lP.png" alt="like this]"></p>
  
  <p>I can retrieve image name as you can see in Image Column, but I am not able to display it.</p>
  
  <pre><code>&lt;DataGrid.Columns&gt;
      &lt;DataGridTextColumn Header="ID" Binding="{Binding Path=Studentid}"/&gt;
          &lt;DataGridTemplateColumn Header="Picture" Width="50"&gt;
              &lt;DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Image Stretch="Fill" Source="{Binding Images/Students/ImageColumnNameInDatabase}"/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/DataGridTemplateColumn.CellTemplate&gt;
          &lt;/DataGridTemplateColumn&gt;
   &lt;/DataGrid.Columns&gt;
  </code></pre>
  
  <p>My c# code for filling the datagrid</p>
  
  <pre><code>conn = new SqlConnection(connstring);
  conn.Open();
  cmd = new SqlCommand("Select * From AddStudentTb", conn);
  try
  {
      DataGridView dv = new DataGridView();
      SqlDataAdapter da = new SqlDataAdapter(cmd);
  
      da.Fill(dt);
      datagridv.ItemsSource = dt.DefaultView;
  }
  finally
  {
      conn.Close();
  }
  </code></pre>