Reading image from sql server into DataTable

GornHorse

Centurion
Joined
May 27, 2003
Messages
105
Location
Australia
I have a datatable which is the data source for a datagrid within my asp.net page. In vb.net, how can i read the image data out of the sql server, and them dump it into a the datatable. And, how do i set up the datagrid to be able to appropriately read the image information out of the datatable?

My image is held within my sql database as an 'image' type. I have read all the articles I can find, and all they do is show how to display 1 image onto the screen, but i need to show each image (specific to each record) firstly within a datatable, and then databind this to the datagrid.

Please offer some assistance with this extremely quickly??!!

Thanks in advance,

Michelle
 
This is probably not what you want to here... have you considered storing the path to the image in the database instead of the image itself. This would be much more effiient for speed and space on SQL Server.

If you're willing to go that route I can help you.
 
Hi There,

It is OK now, i have figured it out. There were some articles regarding this for use with straight datagrids, so I slightly modified the format, and figured out all I had to do was pass the 'imageurl' the id of the image, and use the codebehind on the other url to just retrieve the image.

It is a two-step process, but works very well.

If anyone is interested, go to http://aspalliance.com/141

Cheers,
Michelle
 
Back
Top