Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends,

iam doing stroing and retriveing the images from database and display in th gridview control
please refer the following URL

RETRIEVE IMAGES USING A FILE PATH STORED IN DATABASE IN ASP.NET

Now my Problem is not getting the image into girdview from database.could you any one can help me friends.


Regards
Krishna
Posted
Updated 22-Dec-13 21:40pm
v4
Comments
Ganesh KP 23-Dec-13 1:15am    
I think u are saving relative path in your database (like images/file name...) and when u retrieve the file path from the database, check with the absolute path (like YourprojectDirectory/ImagesFoldername/Filename) and check in your windows explorer. if the image is shown opened in your folder then I think it is wokring if it not showing, then there is a problem with your image path.

try that and let us know.

 
Share this answer
 
Comments
Member 10453510 23-Dec-13 1:33am    
Still it is not getting.... i could not understand where the problem is occured but there is no buks are rised in .aspx file and .aspx.cs file could you please help me for solve this problem.


and this is my .aspx.cs file


SqlConnection con=new SqlConnection(cs);
SqlDataAdapter da =new SqlDataAdapter("select * from Images",con);
DataTable dt=new DataTable();
da.Fill(dt);
GridView1.DataSource=dt;
GridView1.DataBind();
JR009 23-Dec-13 2:22am    
hey friend,
check your database table and its fields datatypes. Also check the file path of the stored images in the database table.
<asp:TemplateField HeaderText="Client Image">
<ItemTemplate>
<asp:Image ID="Image1" ImageUrl='<%#Eval("client_image_url") %>' Width="100"
Height="100" runat="server" />
</ItemTemplate>
</asp:TemplateField>


Here client_image_url is your database field which contains image path.
 
Share this answer
 
Comments
Member 10453510 23-Dec-13 1:15am    
hi..
Still it is not getting

this is my aspx code for gidview



<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<columns> .
.

<asp:TemplateField HeaderText="ID">
<itemteplate>
<asp:Image ID="image" ImageUrl='<%#Eval("FilePath")%>' runnat="server">




but still it is not working
Jignesh Khant 23-Dec-13 1:32am    
Try putting it inside ItemTemplate like this:

<asp:TemplateField HeaderText="ID">
<itemtemplate>
<asp:Image ID="image" ImageUrl='<%#Eval("FilePath")%>' runnat="server"/>

Member 10453510 23-Dec-13 1:46am    
Ya already tried but not getting

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900