Click here to Skip to main content
15,434,147 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my code that generate error when saving picture to db == A generic error occurred in GDI+. Anybody please help me with this. Thank you very very much.

If Not Me.pictureboxName.BackgroundImage Is Nothing Then
            Dim ms As MemoryStream = New MemoryStream
            Me.pictureboxName.BackgroundImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
            Dim data As Byte() = ms.GetBuffer()
            Dim p As New SqlParameter("@photo", SqlDbType.Image)
            p.Value = data
        End If
[no name] 24-Mar-14 21:57pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900