Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to bind binary images to GridView and ListView from database. I have database table with 2 columns ( ImageID (data type: int), Image(data type: Image))

Any Idea?
Posted
Updated 24-Jan-11 4:12am
v2

 
Share this answer
 
Comments
Maho^^^ 26-Jan-11 11:44am    
thank you for the link really it helped me to understand how to deal with handlers in asp.net
appreciate your help
best regards
Prerak Patel 26-Jan-11 12:51pm    
You are welcome.
check this link, it will help you
Image Handling In ASP.NET[^]
 
Share this answer
 
Comments
Maho^^^ 26-Jan-11 11:44am    
thank you for the very helpful link... wonderful content of image handling - creating thumbnails, watermarks etc etc ... i have to sum really nice work nicely done.
I appreciate your help

best regards
int NewsId = Int16.Parse(Request.QueryString["id"]);
DataTable dt = new DataTable();
dt = obj.GetNewsById(Operation, NewsId);
byte[] data =(byte[])obj.GetNewsById(Operation,NewsId).Rows[0]["photo"];
if (data != null)
{
Byte[] bytImage = (data);
if (bytImage != null && bytImage.Length != 0)
{
Response.ContentType = "image/jpeg";
Response.Expires = 0;
Response.Buffer = true;
Response.Clear();
Response.BinaryWrite(bytImage);
Response.End();
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900