Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Ankur
(100)
Avinash Mohan
(100)
Pawan
(80)
Last 7 Days
Alwyn
(739)
nishithraj
(512)
Ankur
(449)
more...
Resources
»
Code Snippets
»
Images
»
Retrieve images from database in a gridview
Posted Date: 19 Jun 2009
Resource Type:
Code Snippets
Category:
Images
Author:
Nikhil Gaur
Member Level:
Diamond
Rating:
Points
: 10
This is a sample code to retrieve images from data base in a gridview as to upload images to database.
use fileupload control to upload images and on upload button click retrieve image from fileupload control(named as fulimage)by writing
StreamimgStream = fuImage.PostedFile.InputStream;
and insert it into database along with other parameters.
to retrieve image from database in a gridview use generic handler. place a template in gridview and place itemtemplate in it.now add a image here like this.
and in the ImageHandler.ashx get image id from query string and retrive image from database in a datareader then return that image by this code
context.Response.BinaryWrite((Byte[])dr[0]);
here dr[0] means that image is in first field of the database.
Attachments
Retrieve images from database in a gridview
(29410-191618-GridviewImage.rar)
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
Retrieve
.
Image
.
Gridview
.
Database
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Resize an image's dimensions and Save it as a file in different extension
Previous Resource:
Creating Thumbnail Images in C#
Return to Discussion Resource Index
Post New Resource
Category:
Images
Post resources and
earn money
!
More Resources
Resize an image's dimensions and Save it as a file in different extension
Convert An Image to Thumbnail In VB .Net
Save image into Database and folder in C#
Custom drawing in Images
Writing a gif to a browser request for an img tag
Reading images from Excel using office interop
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use