Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Puling pictures from a varbin row

Author  Topic 

sangoku
Starting Member

19 Posts

Posted - 2009-09-01 : 15:08:01
Hy again in tinkering a bit with my seminar work and it came to my mind what if the professor wants me to extract the stored images from the varbin(max) value

I inserted the image via the simple procedure:

INSERT INTO Korisnik
(UserName)
VALUES
(
((SELECT * FROM OPENROWSET(BULK N'C:\Users\Goku\Desktop\1.JPG', SINGLE_BLOB) as 1)),

)

How can i actually exstract the image back

while earth still spining
live on, have fun
else
move to mars

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-09-01 : 15:18:23
its a bad practice to store images in your db. Store the images in a folder and put the relative path in your db and you can reference it in your presentation layer (frontend)
Go to Top of Page

sangoku
Starting Member

19 Posts

Posted - 2009-09-01 : 15:35:26
Know it know it it is just a demonstration db for a seminar work not a real application use so how cani get it out XD

Pretty please and exclude the bad thing warning constraint ~.~

while earth still spining
live on, have fun
else
move to mars
Go to Top of Page

sangoku
Starting Member

19 Posts

Posted - 2009-09-01 : 17:40:07
so none knows how to pull it up? QQ

while earth still spining
live on, have fun
else
move to mars
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-01 : 17:44:54
Well, you get it out of the table using the SELECT statement. Displaying that data as an image requires some kind of application code, SQL Server cannot display images. Best thing to do is Google for "display sql image" and check ASP.Net websites.

BTW, don't be discouraged if it's too difficult or you don't get it done in time, you can present to your seminar as an example of what NOT to do.
Go to Top of Page

sangoku
Starting Member

19 Posts

Posted - 2009-09-02 : 05:52:32
Lol well i surfed in varios forums and it seems the problem is more severe than i anticipated. Well i can try to convince my professor that it was a error but i dont belive he will listen QQ eny ideas at all how to output the data so it is readable by a picture viewing program?

while earth still spining
live on, have fun
else
move to mars
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-02 : 07:18:51
http://aspnet.4guysfromrolla.com/articles/120606-1.aspx
Go to Top of Page

eralper
Yak Posting Veteran

66 Posts

Posted - 2009-09-02 : 14:22:05
You can display images saved on a database using an ASP.NET application easily as demonstrated at [url]http://www.kodyaz.com/articles/file-upload-and-save-to-sql-server.aspx[/url]




-------------
Eralper
http://www.kodyaz.com
Go to Top of Page
   

- Advertisement -