Search
MVC Online Training
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Forums Author
Sat, 20-Sep-2014 Authors
All Time Authors
Jayakumars
4170
Karthikanbarasan
3455
Chvrsri
3140

Latest members | More ...


(Statistics delayed by 5 minutes)
 Forum Post

view image from database to asp page [Resolved]

Bshan
Posted by Bshan under ASP.NET on 7/16/2012 10:55:34 AM | Points: 10 | Views : 1963 | Status : [Member] | Replies : 7


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.



Posted by: Hariinakoti on: 7/16/2012 [Member] Starter | 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. | Alert Moderator

Posted by: Patel28rajendra on: 7/16/2012 [Member] Starter | Points: 25

Posted by: Patel28rajendra on: 7/16/2012 [Member] Starter | Points: 25

Posted by: GSM_GSV on: 7/17/2012 [Member] Starter | 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. | Alert Moderator

Posted by: Bshan on: 7/17/2012 [Member] Starter | Points: 25

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

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

Posted by: Ranjeet_8 on: 7/17/2012 [Member] Gold | Points: 25

Refer this url
it will help u

http://www.codeproject.com/Articles/33310/C-Save-and-Load-Image-from-Database

.

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

Posted by: Patel28rajendra on: 7/18/2012 [Member] Starter | 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. | Alert Moderator

Login to post response


Found interesting? Add this to: