Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to reteive Images from sql server db?

This is a discussion on How to reteive Images from sql server db? within the ASP.NET forums, part of the Web Development category; Hi.., I have stored my images in SQl server database in an application using ASP.NET with C#. But now I want to retrieve those images in a Gridview. My code ...

Go Back   Geeks Talk > Web Development > ASP.NET
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

ASP.NET ASP.NET and ASP Related Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2009
Junior Member
 
Join Date: Jun 2009
Location: baroda
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
MoumitaRoyChoudhury is on a distinguished road
How to reteive Images from sql server db?

Hi..,

I have stored my images in SQl server database in an application using ASP.NET with C#. But now I want to retrieve those images in a Gridview. My code is running fine in all aspects except that in the image field it is showing System.Byte[] instead of the image.

Can anyone help me out in this matter? I have not used any dataset for it. Is it possible to do this in my way?

Thanks in advance..!!

Last edited by MoumitaRoyChoudhury; 07-31-2009 at 04:54 AM. Reason: forgot to write ASP .NET in the subject line
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-12-2009
Junior Member
 
Join Date: Aug 2009
Location: Chennai
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
chinnakulandaiv is on a distinguished road
Re: How to reteive Images from sql server db?

Code to retrieve the image from dtabase public sub page_load(sender as object, e as eventargs) dim myconnection as new sqlconnection(configurationsettings.appsettings("connectionstring")) dim mycommand as new sqlcommand("select * from person", myconnection) try myconnection.open() dim mydatareader as sqldatareader mydatareader = mycommand.executereader(commandbehavior.closeconnection) do while (mydatareader.read()) response.contenttype = mydatareader.item("personimagetype") response.binarywrite(mydatareader.item("personimage")) loop myconnection.close() response.write("person info successfully retrieved!") catch sqlexc as sqlexception response.write("read failed : " & sqlexc.tostring()) end try end sub
Reply With Quote
Reply

  Geeks Talk > Web Development > ASP.NET

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
what is the difference between application server, web server and portal server? vinothkumarbaskaran Web Servers 17 10-13-2009 12:02 PM
Read and write images in vb.net from a database using SQL Server solvequeries VB.NET 2 06-20-2009 04:31 AM
C# Storing Images swathi.ch C# 2 05-19-2008 07:45 AM
not able to seen some of the images... psuresh1982 Suggestions & Feedback 8 12-20-2006 12:47 PM
Playing with images Lokesh M Geeks Lounge 0 09-23-2006 05:30 AM


All times are GMT -4. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved