Click here to Skip to main content
13,088,846 members (63,345 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,
How to show image from a sql server table into a dynamically created gridview.
I have created the grid view and i am able to retrieve all other data in it from sql table, only image type data from the table is not being retrieved.
Shall be greatly obliged for your help.
Posted 7-Dec-12 19:51pm
Master Black 8-Dec-12 1:55am
Hi Skand Pratap,

Can you tell me how you are saving the image information in the database?
What is your datatype for storing the data in the database table?
Skand Pratap Singh 8-Dec-12 2:23am
Hi Master Black,
I am creating my data base in the following way
use Skand
create table Image_Gallery
Img_Id int,
Image_content image,
Image_type varchar(50),
Image_Size int
select * from Image_Gallery
Master Black 8-Dec-12 3:25am
Hi Skand Pratap,

According to me and the experts if you store the data of the image in the data base the database will be overloaded. And the image will be stored as binary data. You need to convert the binary to image format in the code behind which is another long process. This will slow down the data processing. Your page will take more time to load. So its better that you just save the path information in the database and access the image in the code behind.

please follow the following link.

If you want the solution for the image to be displayed in the grid then I will show you the way to achieve the image in the grid...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi Skand Pratap,

Please find your solution in the below link. This may help you.

Image from database
Skand Pratap Singh 10-Dec-12 0:35am
Thank you very much. +5
Master Black 12-Dec-12 10:05am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100