473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how to show an Image field from a SQL Server table field to a aspx page

Hi,
I have a browse page where I am showing few fields from my SQL Server
table. One of the field is Image type, all the fields are bound to a
single table.

I want to show the image from the table on this browse along with the
other fields. Here is the code what I have from the HTML view, I am
using a datagrid to show the result. It does not show the image rather
it shows "System.Byte[] " on the output. I did not have any code
behind page logic for this image field (mypicture).

Thank you.

Sahoo J
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>


<asp:datagrid id=DataGrid1 runat="server" ForeColor="Black"
Width="520px" BorderColor="Tan" Height="358px" DataSource="<%# DsPict1
%>" DataMember="SahooPhoneTbl" AutoGenerateColumns="False"
BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2"
GridLines="None">
<SelectedItemStyle ForeColor="GhostWhite"
BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle
BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:HyperLinkColumn Text="Edit"
DataNavigateUrlField="Employee_Id"
DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usrAction=Edt">
<HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:HyperLinkColumn Text="Delete"
DataNavigateUrlField="Employee_Id"
DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usrAction=Del">
<HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:TemplateColumn HeaderText="Status">
<HeaderStyle Font-Bold="True"></HeaderStyle>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<div align="center">
<IMG SRC='<%# Container.DataItem("mypicture") %>'
Border="0">
<br>
<%# (Container.DataItem("mypicture")) %>
</div>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="Phone" SortExpression="Phone"
HeaderText="Phone"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" SortExpression="Name"
HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Employee_Id"
SortExpression="Employee_Id"
HeaderText="Employee_Id"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center"
ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:datagrid></div>
Nov 18 '05 #1
2 2677
IE does not support inline images. your table should have a url to the
image, then you write an aspx page that display the image. a quick google of
this newgroup will show lots of examples.

-- bruce (sqlwork.com)
"J Sahoo" <sa***@mississippi.org> wrote in message
news:24*************************@posting.google.co m...
Hi,
I have a browse page where I am showing few fields from my SQL Server
table. One of the field is Image type, all the fields are bound to a
single table.

I want to show the image from the table on this browse along with the
other fields. Here is the code what I have from the HTML view, I am
using a datagrid to show the result. It does not show the image rather
it shows "System.Byte[] " on the output. I did not have any code
behind page logic for this image field (mypicture).

Thank you.

Sahoo J
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>

<asp:datagrid id=DataGrid1 runat="server" ForeColor="Black"
Width="520px" BorderColor="Tan" Height="358px" DataSource="<%# DsPict1
%>" DataMember="SahooPhoneTbl" AutoGenerateColumns="False"
BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2"
GridLines="None">
<SelectedItemStyle ForeColor="GhostWhite"
BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle
BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:HyperLinkColumn Text="Edit"
DataNavigateUrlField="Employee_Id"

DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usr
Action=Edt"> <HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:HyperLinkColumn Text="Delete"
DataNavigateUrlField="Employee_Id"
DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usr
Action=Del"> <HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:TemplateColumn HeaderText="Status">
<HeaderStyle Font-Bold="True"></HeaderStyle>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<div align="center">
<IMG SRC='<%# Container.DataItem("mypicture") %>'
Border="0">
<br>
<%# (Container.DataItem("mypicture")) %>
</div>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="Phone" SortExpression="Phone"
HeaderText="Phone"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" SortExpression="Name"
HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Employee_Id"
SortExpression="Employee_Id"
HeaderText="Employee_Id"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center"
ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:datagrid></div>

Nov 18 '05 #2
I am intrested in knowing how to get an image from a database field, I
was able to do it thru a link from the HTML. But how do I convert this
image (from a database field) to show it on a datagrid (so that HTML
can show it). Any sample code will be appreciated. Thanks.

Sahoo J

"bruce barker" <no***********@safeco.com> wrote in message news:<OP**************@tk2msftngp13.phx.gbl>...
IE does not support inline images. your table should have a url to the
image, then you write an aspx page that display the image. a quick google of
this newgroup will show lots of examples.

-- bruce (sqlwork.com)
"J Sahoo" <sa***@mississippi.org> wrote in message
news:24*************************@posting.google.co m...
Hi,
I have a browse page where I am showing few fields from my SQL Server
table. One of the field is Image type, all the fields are bound to a
single table.

I want to show the image from the table on this browse along with the
other fields. Here is the code what I have from the HTML view, I am
using a datagrid to show the result. It does not show the image rather
it shows "System.Byte[] " on the output. I did not have any code
behind page logic for this image field (mypicture).

Thank you.

Sahoo J
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>


<asp:datagrid id=DataGrid1 runat="server" ForeColor="Black"
Width="520px" BorderColor="Tan" Height="358px" DataSource="<%# DsPict1
%>" DataMember="SahooPhoneTbl" AutoGenerateColumns="False"
BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2"
GridLines="None">
<SelectedItemStyle ForeColor="GhostWhite"
BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle
BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:HyperLinkColumn Text="Edit"
DataNavigateUrlField="Employee_Id"

DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usr
Action=Edt">
<HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:HyperLinkColumn Text="Delete"
DataNavigateUrlField="Employee_Id"

DataNavigateUrlFormatString="MaintCourseCode.aspx? parmCourseCode={0}&amp;usr
Action=Del">
<HeaderStyle Font-Bold="True"></HeaderStyle>
</asp:HyperLinkColumn>
<asp:TemplateColumn HeaderText="Status">
<HeaderStyle Font-Bold="True"></HeaderStyle>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<div align="center">
<IMG SRC='<%# Container.DataItem("mypicture") %>'
Border="0">
<br>
<%# (Container.DataItem("mypicture")) %>
</div>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="Phone" SortExpression="Phone"
HeaderText="Phone"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" SortExpression="Name"
HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Employee_Id"
SortExpression="Employee_Id"
HeaderText="Employee_Id"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center"
ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:datagrid></div>

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Bob | last post by:
Hello: I've tried showing an image field from an MS SQL Server 2000 image field on an ASP page but All I get is this http://http://new.confectioneryhouse.com/glutenfree/about.asp I added the...
3
by: Simon Harris | last post by:
Hi All, I have a data grid which displays country names. I now wish to display the country flag images above the names. Can someone please advise how I display an image in a datagrid? I have a...
1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
1
by: NH | last post by:
Hi, I'm struggling to display an image on asp.net webform (vb.net). The image is stored in a image field in a sql server database. I have read a good few solutions to it and still havnt got it...
13
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't...
7
by: hsegoy1979 | last post by:
Dear All Iam using file upload control and i want to display image in another pop up page .But image is not displaying in image control iam sending image path thru querystring . here is my code ...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.