title: Display Images in gridview (Multiple Images)
body: <p>I have implemented a functionality where the Images path gets stored in the database and the Images are stored in the server.</p>
  
  <p>Now, what i want is whenever the images has been uploaded, the path should gets saved in the table and from there I want the images to be shown in the gridview. </p>
  
  <p>I have made a gridview for displaying the Images, currently it is taking the <code>Image_path</code> in that column i want to display <code>Images</code> instead of path.</p>
  
  <p>Also, Please see the code of Gridview:</p>
  
  <pre><code>&lt;asp:GridView ID="grdGalleryData" runat="server" Width="100%" border="1"
                Style="border: 1px solid #E5E5E5;" CellPadding="3" AutoGenerateColumns="False"
                AllowPaging="True" PageSize="2" CssClass="hoverTable" DataKeyNames="Id"&gt;
      &lt;AlternatingRowStyle BackColor="#CCCCCC" /&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="Select" ItemStyle-Width="30" HeaderStyle-CssClass="k-grid td"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="chkDelete" runat="server" /&gt;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle CssClass="k-grid td"&gt;&lt;/HeaderStyle&gt;
              &lt;ItemStyle Width="30px"&gt;&lt;/ItemStyle&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField DataField="gallery_id" HeaderText="Id" ItemStyle-Width="25" HeaderStyle-CssClass="k-grid td" /&gt;
          &lt;asp:BoundField DataField="image_title" HeaderText="Gallery title" ItemStyle-Width="25" HeaderStyle-CssClass="k-grid td" /&gt;
          &lt;asp:BoundField DataField="image_description" HeaderText="Gallery Description" ItemStyle-Width="25" HeaderStyle-CssClass="k-grid td" /&gt;
          &lt;asp:BoundField DataField="image_path" HeaderText="Images" ItemStyle-Width="25" HeaderStyle-CssClass="k-grid td" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Code behind for inserting the images into the table:-</p>
  
  <pre><code>protected void btnAdd_Click(object sender, EventArgs e)
  {
      if (FileUpload1.HasFile == false)
      {
          ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", "&lt;script&gt;alert('Please select the file.')&lt;/script&gt;", false);
      }
      else
      {
          foreach (var file in FileUpload1.PostedFiles)
          {
              string filename = Path.GetFileName(file.FileName);
  
              FileUpload1.SaveAs(Server.MapPath("/GalleryImages/" + filename));
  
              SqlCommand cmd = new SqlCommand("Insert into tbl_gallery_stack(gallery_id, image_title, image_description, image_path) values (@gallery_id,@image_title,@image_description,@image_path)", conn);
  
              cmd.Parameters.AddWithValue("@gallery_id", ddlImagesId.SelectedValue);
              cmd.Parameters.AddWithValue("@image_title", txtImageTitle.Text);
              cmd.Parameters.AddWithValue("@image_description", txtImageDescription.Text);
              cmd.Parameters.AddWithValue("@image_path", filename);
              conn.Open();
              cmd.ExecuteNonQuery();
              BindGrid();
          }
      }
  }
  </code></pre>
  
  <p>Please let me know how to display Images in the gridview here.</p>