Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all

I have a varbinary(max) column in sql server database table and i am fetching this data..I am inserting image in this column

How can display image in image control or in any other way
Posted
Updated 6-Jan-12 4:49am
v2

See this link also

http://forums.asp.net/p/1379716/2913448.aspx[^]

Thanks
 
Share this answer
 
Assuming that the data from the database is the content of an image file, you would just need to send it to the client. It is actually quite easy. Have a look at the link for more info and some example code:
http://www.aspsnippets.com/Articles/Display-Images-from-SQL-Server-Database-using-ASP.Net.aspx[^]

Good luck!
 
Share this answer
 
Storing and Retrieving Images from SQL Server using Microsoft .NET[^]

http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspx[^]


please search google or codeproject first if you don't get any help then ask here with code where you are getting error.

Thanks
 
Share this answer
 
C#
<img runat="server" id="image" />

And in code behind do this:
C#
image.src="data:image/png;base64,"+Convert.ToBase64String(imageBytes);
 
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