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. |
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 ...
|
|||||||
|
|||
|
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 |
| Sponsored Links |
|
|||
|
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
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |