i am trying to display img from db to grid view but it is not working pls help me i image was successfully inserted but unable to display
void GridView() { string q = "select * from masterwithimg"; SqlCommand cmd = new SqlCommand(q, con); SqlDataAdapter da = new SqlDataAdapter(cmd); con.Open(); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); con.Close(); }
This is my source
<asp:TemplateField HeaderText="Image"> <ItemTemplate > <asp:Image ID="Image1" runat="server" ImageUrl ='<%#Eval("aadhar") %>' height="120px" Width="150px" /> </ItemTemplate> </asp:TemplateField>