Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I am working with a database that contains 4 columns (ID, surname, lastname, profilepicture). I have added data and want to show them in gridview in visual studio.

I have added a SqlDataSource and the right data is shown when I "test query". But when i open the site, the picture-column/data is not shown!?!

I have also tried to "add a column" and selected "ImageField" and the right column from the database. But I dont understand what I should write in the field for "URL format string"?? The datatype in the database is "image"

Any help?

[^] Here is the "add new column" window where the URL is supposed to be written

What I have tried:

Tried to find the path, but cant seem to connect it right!?!
Posted
Updated 9-Mar-17 4:07am
v2

1 solution

Personally I wouldn't store the actual image on my database - I would store the image in a folder and would just store it's location on the table - in which case you could just put that in the field. However, sticking with the way you have done it then this article should help:Using Gridview to display Images from Database[^]
 
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