To get the bytes for the image, do the following.
Note: if you're not using JPEG, change the format.
byte[] bytes;
using (var stream = new MemoryStream())
{
image.Save(stream, ImageFormat.Jpeg);
stream.Flush();
bytes = stream.ToArray();
}
This assumes
image
is a variable you have previously initialized with the image you want to save.
After this, you just pass the value of
bytes
as a parameter into your
SQL INSERT
command.