I see some reasons for this. The first of these is that the Image
data type will be removed in any future version of SQL Server. (Html ) The ntext, text, and image data types will be removed in a future release of Microsoft SQL Server
The Image
of the System.Drawing
library is not equivalent to the Image
field of the Sql Server, and did not do any "mapping" to it. I agree that it would even be simpler though, it is not difficult to convert an image to an array of bytes:
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
System.Drawing.Imaging.ImageFormat.Gif
you replace with whatever shape your image is. (MSDN) Image Formats . I removed this code from StackOverflow.com (question 17352061)
In addition, this image
field contains nothing more than Dados binários do comprimento variável de 0 a 2^31-1 (2.147.483.647) bytes.
, as the first msdn link that I sent you cites.
I hope I have helped. As for the example, give it a google search, it is very easy to find.