Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
1.18/5 (3 votes)
See more:
How to dynamic add image in picture box and image get from database
Please help me
Posted
Comments
[no name] 20-May-14 15:14pm    
What have you tried? What is wrong with the code that you wrote? In what way does it not do what you think it should?

1 solution

Basically it is good to have storing the images in server and save the appropriate path in the field of the entity and while retrieving just set the path for the image control after getting it from database.
Ex :- Let say we have a image with id 'imgTest'.
C#
string imageURL = "~/images/image.png";// URL from database varchar type column
imgTest.ImageUrl = imageURL;


OR

you can also directly save the image in database as varbinary type field.
Please see this example mentioned here.[^]

Hope this will definitely of help to you.
 
Share this answer
 
v2

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