Guest User

Guest User

  • Tech Writer
  • 39
  • 11.2k

How to show image on DataGridView?

Feb 5 2018 4:23 AM
My sql procedure is:
  1. ALTER proc [dbo].[sp_Load_GridView]  
  2. AS  
  3. BEGIN  
  4. SET NOCOUNT ON;  
  5. SELECT Employee_ID,Employee_Name, Emp_Photo FROM Employee_Information  
  6. END  
but image not showing in grid,
 
Here is my code:
  1. SqlCommand cmd = new SqlCommand("sp_Load_GridView", con);  
  2. cmd.CommandType = CommandType.StoredProcedure;  
  3. SqlDataAdapter sda = new SqlDataAdapter(cmd);  
  4. DataTable dt = new DataTable();  
  5. try  
  6. {  
  7. sda.Fill(dt);  
  8. dataGridView1.DataSource = dt;  
  9. }  
  10. catch (SqlException ex)  
  11. {  
  12. MessageBox.Show(ex.Message)  
  13. }  
  14. finally  
  15. {  
  16. con.Close();  
  17. con.Dispose();  
  18. }  

Answers (3)