stream directly into database

  • Thread starter Thread starter Tobias Matzat
  • Start date Start date
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
 
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.
 
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.
 
Back
Top