SQL Database

Jun 12, 2008 at 4:23 PM
Great application but one major flaw (in my opinion). MANY of us store images in SQL Databases.

I'd be grateful if anyone can tell a novice like myself how to simply point the data.xml file to image stored in my databases rather than a folder on te server.
Jun 12, 2008 at 5:27 PM

Hi There

I've hooked it up to my database by generating the data.xml file 'on the fly'

go to http://www.bennysutton.com/Silverlight/SlideShow.aspx to get the code

Working demo here

Hope this helps

Benny Sutton

Jun 13, 2008 at 5:32 AM
Hi, Benny.

Thanks for the reply (and, love the photos!)

This looks like what I'm after. I'd appreciate a favour. Would you be prepared to "spell it out" for me a little. I understand the Slide.Show application and how to use SQL to store images but I'm new to VB and, looking at your code, I'm not sure what I need to use verbatim and what I need to replace to suit my environment/application. Could you help with this.

Also, where does the code go?

You must be sighing and wishing you hadn't responded. I'd be grateful if you wouldn't hit delete right now...

Thanks,
Mike
Jun 17, 2008 at 3:02 PM
Perhaps I misunderstood the original question Mike. 
Are you interested in pulling an image from a database or generating the data.xml file from a database?

If you want to pull the image directly from the database, here is what you can do.

The idea is that you can create an aspx page that behaves like an image.
An image html tag, for example, would look something like this <img src=http://www.mysite.com/getimage.aspx?name=imagename.jpg /> .

This is done via changing its content type and writing the image into the outputstream. 
It is much less complicated then it sounds by the way. 

Did a quick Google search with these keywords: aspx database image contentype
This link looks well done and would be a great place to start, so I included it below:
 - http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/

-- Thomas
Jun 17, 2008 at 4:06 PM
I've made a little progress on this. What I was interested in doing was pointing the data.xml file to the images in my database but I've worked out an easy bit of VB to store the uploaded images into a folder so no problem.

However, what I'd really like now is a way of creating the data.xml file dynamically from data entered through an asp.net page. I have a client's Content Management System which work well. It includes the ability for the client to create his own "categories" of images. The flat data.xml file is useless (to me) for this. I'd like to somehow create that file "on the fly" from whatever categories are in the database and for however many images are in each category.

If you know how to do this, keep it simple: I'm not bad with asp.net but just beginning VB.

Thanks,
Mike

ThomasBrabender wrote:
Perhaps I misunderstood the original question Mike. 
Are you interested in pulling an image from a database or generating the data.xml file from a database?

If you want to pull the image directly from the database, here is what you can do.

The idea is that you can create an aspx page that behaves like an image.
An image html tag, for example, would look something like this <img src=http://www.mysite.com/getimage.aspx?name=imagename.jpg /> .

This is done via changing its content type and writing the image into the outputstream. 
It is much less complicated then it sounds by the way. 

Did a quick Google search with these keywords: aspx database image contentype
This link looks well done and would be a great place to start, so I included it below:
 - http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/

-- Thomas


Jun 19, 2008 at 8:35 AM

Hi

Every one

I think The question that raised over here it to Pull all the Images From a Specific Folder.

So What it will do is Pull all the Images in a folder and generate Data.xml on the Fly. is it

I also really want that to be happen so My slide show will be Dynamic.

-- Mehfuz

Jun 24, 2008 at 12:17 AM
I did it like this:

http://www.codeplex.com/SlideShow/Thread/View.aspx?ThreadId=22481