What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 9577 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > view image from database to asp page ...
Bshan

view image from database to asp page

Replies: 7 | Posted by: Bshan on 7/16/2012 | Category: ASP.NET Forums | Views: 727 | Status: [Member] | Points: 10  


Hi,
I am try to view an image from database. I used handler and invoke it by following code..

<asp:GridView ID="gvImage" runat="server" AutoGenerateColumns="false">
<columns>
<asp:TemplateField >
<ItemTemplate>
<asp:Image ID="Image2" runat="server" ImageUrl='<%# "ShowImage.ashx?StudentID=" + Eval("StudentID") %>' AlternateText="N/A" />
</ItemTemplate>
</asp:TemplateField>
</columns>
</asp:GridView>

But it not working. The error flashes is.....
Conversion from string "ShowImage.ashx?StudentID=" to type 'Double' is not valid.


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Hariinakoti
Hariinakoti  
Posted on: 7/16/2012 12:03:41 PM
Level: Starter | Status: [Member] | Points: 25

@Bshan
Can u post wat u wrote code in cs

Thanks & Regards
Hari

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 7/16/2012 1:59:25 PM
Level: Starter | Status: [Member] | Points: 25

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 7/16/2012 2:01:09 PM
Level: Starter | Status: [Member] | Points: 25

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

GSM_GSV
GSM_GSV  
Posted on: 7/17/2012 1:51:09 AM
Level: Starter | Status: [Member] | Points: 25

You can store your images in a folder with ID as 1, 2, 3 etc which will be PK of your database. If you store your image in DB, it will be stored as binary. So, conversion problems may occur.
What I mentioned is just another way. You can do it by storing your image in database also

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Bshan
Bshan  
Posted on: 7/17/2012 2:17:02 AM
Level: Starter | Status: [Member] | Points: 25

Its work and thank for you support......

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Ranjeet_8
Ranjeet_8  
Posted on: 7/17/2012 4:57:09 AM
Level: Gold | Status: [Member] | Points: 25

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Patel28rajendra
Patel28rajendra  
Posted on: 7/18/2012 1:09:23 AM
Level: Starter | Status: [Member] | Points: 50

Resolved

Hi

If you got the Answer please Mark it as Answer

R D Patel

Bshan, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 2:44:32 AM