Created
January 9, 2018 15:45
-
-
Save riccardopirani/3860d155be714bdcd659dc2ca23d97d3 to your computer and use it in GitHub Desktop.
Errore GDI+ system.runtime.interopservices.externalexception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| byte[] photo_aray = new byte[0]; | |
| try | |
| { | |
| //inserimento immagine di una distinta | |
| MemoryStream ms; | |
| ms = new MemoryStream(); | |
| pictureBoxCheckImmagine.Image.Save(ms, ImageFormat.Jpeg); | |
| photo_aray = new byte[ms.Length]; | |
| ms.Position = 0; | |
| ms.Read(photo_aray, 0, photo_aray.Length); | |
| cmdIns.Parameters.Add("@Images", SqlDbType.Binary).Value = photo_aray; | |
| } | |
| catch (Exception ex) | |
| { | |
| MessageBox.Show("Non ho inserito l'immagine: " + ex); | |
| cmdIns.Parameters.Add("@Images", SqlDbType.Binary).Value = photo_aray; | |
| Managementerror.SendError(ex.ToString()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment