Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Control
Message
De
27/06/2005 08:53:17
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
25/06/2005 21:30:42
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01026550
Message ID:
01026676
Vues:
22
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform