تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
حل مشكلة A generic error occurred in GDI+.
#1
السلام عليكم
عند حفظ صورة في بكتشر في الداتا تظهر هذه الرسالة
A generic error occurred in GDI+.

كود :
    Dim arrImage() As Byte
       Dim mstream As New System.IO.MemoryStream()
       PictureBox2.Image.Save(mstream, System.Drawing.Imaging.ImageFormat.Png)
       arrImage = mstream.GetBuffer()
       Dim FileSize As UInt32
       FileSize = mstream.Length
       mstream.Close()
cmd..Parameters.AddWithValue("@imgh", arrImage)
اللهم لا علم لنا إلا ما علمتنا
http://www.facebook.com/samira.abdalla.980
الرد }}}
تم الشكر بواسطة:
#2
الرجاء المساعدة
اللهم لا علم لنا إلا ما علمتنا
http://www.facebook.com/samira.abdalla.980
الرد }}}
تم الشكر بواسطة:
#3
هذا كود من احد مشاريع الاخ : حريف برمجة .

PHP كود :
   Private Sub Button9_Click(sender As ObjectAs EventArgsHandles Button9.Click
        
''حفظ الصورة في جدول الصور
        If TextBox2
.Text "" Then
            MsgBox
("قم بتحديد الأسم أولاً من اللست بوكس"64"حريف برمجة")
 
           TextBox2.Focus()
 
           Exit Sub
        End 
If
 
       If (PictureBox1.Image Is NothingThen
            MsgBox
("قم بإدراج الصورة أولاً"64"حريف برمجة")
 
           Exit Sub
        End 
If
 
       '''''''''التأكد من ان رقم السجل موجود في الجدول الأول قبل اضافة الصورة في الجدول الثاني'''''''''
 
       Dim Cmd As New OleDbCommand("select uid from tb1 where uid=@uid"conn)
 
       Cmd.Parameters.AddWithValue("@uid"TextBox1.Text)
 
       conn.Open()
 
       Dim dr As OleDbDataReader Cmd.ExecuteReader
        If dr
.Read False Then
            dr
.Close()
 
           Cmd.Dispose()
 
           conn.Close()
 
           MsgBox("رقم السجل غير موجود في الجدول الأول"64"حريف برمجة")
 
       Else
            Dim ms 
As New System.IO.MemoryStream
            PictureBox1
.Image.Save(msPictureBox1.Image.RawFormat)
 
           Dim picbyte() As Byte ms.GetBuffer
            Cmd 
= New OleDbCommand("insert into tb2 (puid,pphoto,pname) values (@puid,@pphoto,@pname)"conn)
 
           Cmd.Parameters.Clear()
 
           Cmd.Parameters.AddWithValue("@puid"TextBox1.Text)
 
           Cmd.Parameters.AddWithValue("@pphoto"picbyte)
 
           Cmd.Parameters.AddWithValue("@pname"TextBox3.Text)
 
           Cmd.ExecuteNonQuery()
 
           Cmd.Dispose()
 
           conn.Close()
 
           cleartextbox()
 
           MsgBox("تم حفظ السجل بنجاح"64"حريف برمجة")
 
       End If
 
   End Sub 
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم