stream directly into database

T

Tobias Matzat

Hi!

Untill now I'm downloading pictures from the internet, save them and
than put them in a sql server. Is it possible to fetch the files and put
them directly in the database? By the use of stream??

THX!
Tobias
 
M

Murat Karatutlu

i would recommend to get the pictures to any buffer stream such as Memory
Stream then write the contents of the memory stream into the database file.
 
R

Rob Schieber

Tobias said:
Hi!

Untill now I'm downloading pictures from the internet, save them and
than put them in a sql server. Is it possible to fetch the files and put
them directly in the database? By the use of stream??

THX!
Tobias

Hi Tobias,

I would use the HttpWebRequest Class to download your image, use the
GetRequestStream() method, which will return byte[]. Save the byte to a
binary field in SQL Server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top