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?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.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.
thanks in advance...Have you imported the System.Data package?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....
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?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.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.
thanks in advance...Have you imported the System.Data package?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....