sarika sarikaa

sarika sarikaa

  • 1.8k
  • 60
  • 3.4k

Output shows red cross sign in image column instead of image

Dec 31 2017 6:54 AM
con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Admin\source\repos\DATABASE\data2.sql.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
adpt = new SqlDataAdapter("Select * from Details ", con);
dt = new DataTable();
adpt.Fill(dt);
dataGridView.DataSource = dt;
DataGridViewImageColumn imgcol = new DataGridViewImageColumn();
imgcol.HeaderText = "Product Drawing";
dataGridView.RowTemplate.Height = 130;
imgcol.ImageLayout = DataGridViewImageCellLayout.Zoom;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dataGridView.Columns.Add(imgcol);
Image drw;
drw = Image.FromFile(@"C:\Users\Admin\Downloads\ESK DRG (1).jpeg");
 
 
 
 
Please give me a solution. 

Brought to you by:

Answers (2)