I am trying to save a bitmap image to database
Bitmap map = new Bitmap(pictureBoxMetroMap.Size.Width, pictureBoxMetroMap.Size.Height);
I created a column imgcontent
in the database with datatype binary
but my problem is how can I convert this bitmap
(map) to binary data?
And how can I retrieve data from database?
I googled it and I found something like this but it didn't work:
byte[] arr;
ImageConverter converter = new ImageConverter();
arr = (byte[])converter.ConvertTo(map, typeof(byte[]));