Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
[no name] 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
[no name] 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.
http://blog.sqlauthority.com/2007/12/13/sql-server-do-not-store-images-in-database-store-location-of-images-url/

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

Hi Skand Pratap,

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

Image from database
 
Share this answer
 
Comments
Skand Pratap Singh 10-Dec-12 0:35am    
Thank you very much. +5
[no name] 12-Dec-12 10:05am    
yw

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