Jaya Prakash

Jaya Prakash

  • 1.1k
  • 1.4k
  • 18.7k

How to display image from db to gridview

Mar 1 2023 9:50 AM

 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);
            DataSet ds = new DataSet();
            GridView1.DataSource = ds;


This is my source 

 <asp:TemplateField HeaderText="Image">

  <ItemTemplate >

    <asp:Image ID="Image1" runat="server" ImageUrl ='<%#Eval("aadhar") %>' height="120px" Width="150px" />




Answers (8)