Last post Feb 15, 2008 04:37 AM by bhav27
Feb 11, 2008 03:41 PM|bhav27|LINK
I'm getting GDI+ error when saving picturebox image to the database. My database is mysql with longblob datatype. Ideally when I browse image file to the picturebox then save using following code
MemoryStream ms = new MemoryStream();
byte arrImage = ms.GetBuffer();
then it works fine. when I bring back the same image from the database to picturebox and then re-save using the same code it gives me GDI+ exception. Does anyone have any clue why this would happen.
Would Image format be changed? I have also tried gif, jpeg etc image format.. but i get same error.
Feb 13, 2008 09:49 PM|Benson Yu - MSFT|LINK
re-save using the same code it gives me GDI+ exception.
Based on my experience, it is caused by “ASPNET” (IIS 5.x) or “Network Service” (IIS 6.0) accounts lacking of "write" privilege of the saving directory. I have replied a similar post in the following link. Please refer to my post at your convenience.
saving an image at server side
Feb 14, 2008 10:42 AM|bhav27|LINK
It could be but not in this case as my project is not web-based rather I am using windows based project.
Feb 14, 2008 09:48 PM|Benson Yu - MSFT|LINK
I am using windows based project
Since this is ASP.NET forum, the contributors here may not familar with Windows Form issues. It is recommended that you create a thread in Windows Form forum. Thanks for your cooperation.
Feb 15, 2008 04:37 AM|bhav27|LINK
The reason this thread is posted here is because the underlying problem is in ADO.NET.
All I wanted to know is does ADO.NET changes image format when the data gets saved in the database?