Click to See Complete Forum and Search --> : how to read images from database?


deulu
05-10-2005, 04:23 AM
i just inserted into my access database images...
so i have my database similar to this

Itemstable : Table

ItemCode : 1
name : danial
PicLocation : anen.jpg


Now...i wanted to create a new page that can load this image or display it.
Note that when i used to browse for my image to insert it..i used to have a copy of that image in a certain folder created for just images.

Does anyone have any idea how i could display my image, or read them from my database?

buntine
05-11-2005, 03:43 AM
Use the <asp:image> control.

<asp:Image id="someImage" runat="server"
AlternateText="Image Description"
ImageAlign="center"
ImageUrl="" />

You can set the URL explicitly. This assumes your using a DataRowView object.

Dim RowView As DataRowView = DS.Tables("Itemstable").DefaultView(0)
someImage.ImageUrl = RowView("PicLocation")

Regards.

deulu
05-11-2005, 08:05 AM
Sorry..but i didn't get this explicit thing..
what do u mean by setting the url explicitly?

cus it's delivering this compilation error msg:
Compiler Error Message: BC30002: Type 'DataRowView' is not defined.
and that is something normal i believe.

It has to do something with what you said:
"This assumes your using a DataRowView object."
cus it's not assuming that. :D

thanks in advance...

buntine
05-11-2005, 09:41 AM
Have you imported the System.Data package?

deulu
05-11-2005, 10:02 AM
yep..i did

listen...you might get angry to know this now..but i'm working on webmatrix of course after installing .net..
but i don't think that would be that deadly different..right?
i mean i know the difference and where i should makes some changes like the import thing and other stuff....
mmmmmmm....