Basically I am inserting an image using the listviews inserting event, trying to resize an image from the fileupload control, and then save it in a SQL database using LINQ.<
Assuming, that your bitmap is bmp
byte[] data; using(System.IO.MemoryStream stream = new System.IO.MemoryStream()) { bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); stream.Position = 0; data = new byte[stream.Length]; stream.Read(data, 0, stream.Length); stream.Close(); }