تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] خطاء عند عدم رفع الصورة في PictureBox
#4
(28-02-18, 04:16 AM)طالب برمجة كتب :
PHP كود :
Private Sub TBsavecustm_Click(ByVal sender As ObjectByVal e As EventArgsHandles TBsavecustm.Click

    Dim command 
As New SqlCommand("insert into Customer(custname,custadress,custwork,custmob1,custmob2,custidno,custidwno,custother,custpic1,custpic2,custpic3) values(@custname,@custadress,@custwork,@custmob1,@custmob2,@custidno,@custidwno,@custother,@custpic1,@custpic2,@custpic3)"SQLcon)

 
   Dim ms1 As New MemoryStream
    If Not IsNothing
(Piccustm1.ImageThen Piccustm1.Image.Save(ms1Piccustm1.Image.RawFormat)

 
   Dim ms2 As New MemoryStream
    If Not IsNothing
(Piccustm2.ImageThen Piccustm2.Image.Save(ms2Piccustm2.Image.RawFormat)

 
   Dim ms3 As New MemoryStream
    If Not IsNothing
(Piccustm3.ImageThen Piccustm3.Image.Save(ms3Piccustm3.Image.RawFormat)

 
   command.Parameters.AddWithValue("@custname"Texnamecustm.Text)
 
   command.Parameters.AddWithValue("@custadress"Texadresscustm.Text)
 
   command.Parameters.AddWithValue("@custwork"Texworkcustm.Text)
 
   command.Parameters.AddWithValue("@custmob1"Texmob1custm.Text)
 
   command.Parameters.AddWithValue("@custmob2"Texmob2custm.Text)
 
   command.Parameters.AddWithValue("@custidno"Texidcustm.Text)
 
   command.Parameters.AddWithValue("@custidwno"Texwidcustm.Text)
 
   command.Parameters.AddWithValue("@custother"Texothercustm.Text)
 
   command.Parameters.AddWithValue("@custpic1"ms1.ToArray)
 
   command.Parameters.AddWithValue("@custpic2"ms2.ToArray)
 
   command.Parameters.AddWithValue("@custpic3"ms3.ToArray)
 
   ' Dim DT As New DataTable
    ' 
 If Not IsDBNull(DT.Rows(0).Item("@custpic1")) Then
    
' Dim ByteImg As Byte() = DirectCast(DT.Rows(0).Item("@custpic1"), Byte())

    ' 
End If

 
   SQLcon.Open()

 
   If command.ExecuteNonQuery() = 1 Then
        MessageBox
.Show("تمت اضافة المعلومات بنجاح..... شكرا")
 
   Else
        MessageBox
.Show("لم يتم الاضافة ... لابد من جود خطاء او نقص معلومات")
 
   End If

 
   SQLcon.Close()
 
   Load_Customer()
 
   DGVSH.DataSource dt_Customer
End Sub
Private Sub DGVSH_DataError(ByVal sender As ObjectByVal e As DataGridViewDataErrorEventArgsHandles DGVSH.DataError
    
'اترك هذا الحدث كما هو فارغ ولا تحذفه
End Sub 



كلمات الشكر لا تكفيك ابدا
شكرا لك من القلب
الرد }}}
تم الشكر بواسطة: طالب برمجة


الردود في هذا الموضوع
RE: خطاء عند عدم رفع الصورة في PictureBox - بواسطة ابو ملاك الخبير - 28-02-18, 05:01 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  مشكلة في جلب الصورة في التقرير مصمم هاوي 12 1,241 06-06-25, 03:00 PM
آخر رد: atefkhalf2004
  احتاج مساعدة في اظهار الصورة على PictureBox sloom00 2 391 31-12-24, 11:29 PM
آخر رد: sloom00
  حفظ الصورة بالمجلد أحمد فتح الرحمن 7 539 27-11-24, 12:19 AM
آخر رد: atefkhalf2004
  [كود] مسار استرجاع قاعدة البيانات خطاء عند العميل محمد العامر 2 372 12-11-24, 11:24 AM
آخر رد: محمد العامر
  تغيير مكان حفظ الصورة من قاعدة البيانات إلى مجلد في مسار البرنامج F.H.M 37 2,355 05-11-24, 08:30 AM
آخر رد: F.H.M
  أريد كود عند الضغط على الصورة في PictureBox تفتح في برنامج الصور في الويندوز F.H.M 6 636 25-10-24, 01:57 PM
آخر رد: F.H.M
  وميض ومرعشه في الصورة بوحمد 4 445 20-10-24, 10:17 PM
آخر رد: بوحمد
  ممكن طريقة عمل الصورة بشكل دائري بوحمد 3 486 14-10-24, 04:01 PM
آخر رد: بوحمد
  يوجد خطاء فى كود البحث بواستطة الكمبوبوكس واجراء مخزن new_programer 4 409 06-07-24, 12:05 AM
آخر رد: Zuhare
  حفظ الصورة من picture box وحفظها بصيغة pdf جيولوجي مبتدئ 8 764 09-06-24, 04:02 PM
آخر رد: جيولوجي مبتدئ

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


يقوم بقرائة الموضوع: