Image to SqlServer in C#

  • Thread starter Thread starter Adam Goetz
  • Start date Start date
A

Adam Goetz

I had a look and couldn't find what I was after under google, so I'll ask
here.

I want to know how to take an image from a Picture Box (how the image gets
there is irrelevant) and save it in a SQL table. I have found example for
doing it from a file stream in VB.Net, but not a picturebox and I don't have
the knowledge of C# objects to know which ones to use for this task.
If this fails, I will try saving the image, then using a filestream to read
it back in in order to use the example I have found, but that is double
handling and I would prefer not to have to save the image to disk.
 
Hi,

You could save it to a memory stream instead of a FileStream, but I think
that using a stream to save it to is the only solution
 
Back
Top