Hi,

I am using sql data base the image save in database but it doesnt get viewed in data grid view though rest of the items are viewed. Please help me to come out of this solution.

Regards
Creativz

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;


public partial class Default5 : System.Web.UI.Page
{
    SqlConnection db = new SqlConnection("database=bank;server=.;uid=sa");
    SqlCommand cmd = new SqlCommand();


    protected void Button1_Click(object sender, EventArgs e)
    {
        
            

        SqlDataAdapter da = new SqlDataAdapter("select * from loans", db);
        DataSet ds = new DataSet();
        da.Fill(ds,"bank");
        GridView1.DataSource = ds;
        GridView1.DataBind();
         db.Close();
    }
    
    
    }




<asp:GridView ID="GridView1" AutoGenerateColumns="False" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />           
           
            <Columns>
                <asp:BoundField DataField="fathername" HeaderText="Father Name" />
                <asp:BoundField DataField="mothername" HeaderText="MotherName" />
                <asp:BoundField DataField="ms" HeaderText="Martial Status" />
                <asp:BoundField DataField="occupation" HeaderText="Occupation" />
                <asp:BoundField DataField="docname" HeaderText="Doc Name" />
                <asp:ImageField DataImageUrlField="document" HeaderText="document">
                </asp:ImageField>
                <asp:BoundField DataField="address" HeaderText="address" />
                <asp:BoundField DataField="zipcode" HeaderText="Zipcode" />
                <asp:BoundField DataField="phone" HeaderText="Phone" />
                <asp:BoundField DataField="mobile" HeaderText="Mobile" />
                
                   
           
            </Columns>
           
        </asp:GridView>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.