Appear in Online Interview to test your skills and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Submit content and win cash & prizes monthly.
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Forums Author
Thu, 24-Apr-2014 Authors
All Time Authors
Jayakumars
3930
Karthikanbarasan
3455
Chvrsri
3140

Latest members | More ...


(Statistics delayed by 5 minutes)

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 : 1625 | 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.



Reply | Reply with Attachment

=> Scroll below for responses


Comments or Responses

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.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.

Found interesting? Add this to: