i want to retreive a record that has ten columns including a passport.
i have done everything but when i run the program, i succedded in retrieving all the columns
except the image field. please let somebody help.here is where i set the property of the image:

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                        BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
                        CellPadding="2" DataSourceID="SqlDataSource1" ForeColor="Black" 
                        GridLines="None" Height="50px" Width="125px">
                        <FooterStyle BackColor="Tan" />
                        <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                            HorizontalAlign="Center" />
                        <Fields>
                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                                ReadOnly="True" SortExpression="ID" />
                            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                                SortExpression="FirstName" />
                            <asp:BoundField DataField="SecondName" HeaderText="SecondName" 
                                SortExpression="SecondName" />
                            <asp:BoundField DataField="Gender" HeaderText="Gender" 
                                SortExpression="Gender" />
                            <asp:BoundField DataField="ClassTeaching" HeaderText="ClassTeaching" 
                                SortExpression="ClassTeaching" />
                            <asp:BoundField DataField="PhoneNumber" HeaderText="PhoneNumber" 
                                SortExpression="PhoneNumber" />
                            <asp:BoundField DataField="TeachingLevel" HeaderText="TeachingLevel" 
                                SortExpression="TeachingLevel" />
                            <asp:BoundField DataField="Salary" HeaderText="Salary" 
                                SortExpression="Salary" />
                            <asp:ImageField DataImageUrlField="Passport" 
                                DataImageUrlFormatString="Createstaffreply.aspx?ID={0}" HeaderText="Passport">
                            </asp:ImageField>
                        </Fields>
                        <HeaderStyle BackColor="Tan" Font-Bold="True" />
                        <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                        <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    </asp:DetailsView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:localConnectionString %>" 
                        SelectCommand="SELECT * FROM [StaffData] WHERE ([PhoneNumber] = @PhoneNumber)">
                        <SelectParameters>
                            <asp:SessionParameter Name="PhoneNumber" SessionField="PhoneNumber" 
                                Type="String" />
                        </SelectParameters>

</asp:SqlDataSource>

Member Avatar for siju kuriakose

Hi,

First you check whether the image created or not when using the Createstaffreply.aspx?ID={0}" url by giving any value stored in the database field passport as ID.If it is displayed hten there will be no problem normally.
hope your reply

Member Avatar for siju kuriakose

Hi,

If it is not working ,you need to check the url.I don't know where is your
'Createstaffreply.aspx' page,if it is in same folder pls modify url "~/Createstaffreply.aspx?ID={0}" like this.
Hope your reply

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.