Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web Control
Message
From
27/06/2005 08:53:17
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
25/06/2005 21:30:42
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01026550
Message ID:
01026676
Views:
20
This message has been marked as the solution to the initial question of the thread.
>Hi i want to create a web control that allow me to pass the PKID the return the data from DB as image in which i can drop it to my page. do you have any idea?
>I can do it by opening a separate page and render the data as stream
>
>  Response.ContentType = "image/jpeg";		
>  Response.BinaryWrite( (byte[])dtrSearch["DocBin"] );
>  /// DtrSearch is a SqlDataReader
>
>
>but when i creatr a control i can make it work because I cant use the response object any idea or alternative? thanks

Simplicio,

To serve up images from a database, first create a blank web form "ImageServ.aspx". In the page load, use Request.QueryString to get the PKID of the record containing the image and query the column into a byte array. Once you have the data, set the content-type of the response stream to the appropriate image type (jpeg, bmp, gif, or tiff) and send the byte array down the wire through the response stream.

Now in the web form that you want to display the image, put the URL of the ImageServ page with the PKID querystring in the ImageUrl property of an Image web control.
Previous
Reply
Map
View

Click here to load this message in the networking platform