Add a new aspx page in your project like GetImg.aspx, that requires the imageID as a param.
Add a new function or directly in PageLoad
SqlConnection con = new SqlConnection(your_connection);
SqlCommand cmd = new SqlCommand("select Imatge from table where idImge ='" + paramIdImg + "'", con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
if (reader.Read())
{
Response.ContentType = "image/jpg";
Response.Clear();
Response.BufferOutput = true;
SqlBinary sb = reader.GetSqlBinary(0);
Response.BinaryWrite(sb.Value);
Response.Flush();
}
reader.Close();
con.Close();
The column of your gridview must be something like this:
<itemtemplate>>
<asp:image id="Image1" runat="server" backcolor="Transparent" height="75px" imageurl="<%# Eval("YourDbFIeld", "GetImg.aspx?paramImg={0}") %>" width="75px" xmlns:asp="#unknown" />