التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ماذا يعني هذا الخطأ اثناء الحفظ
#1
عند الحفظ يأتي هذا الخطأ مع العلم اني نقلت الكود صحيح من الدورة أفيدوني بارك الله فيكم



لم أعرف حتى مكان الخطأ 

كود :
Try
           Dim Sql = "Select * From ReceiptOfltems Where VoucherCode=N'" & (VoucherCode.Text) & "'"
           Dim Adp As New SqlClient.SqlDataAdapter(Sql, SQLConn)
           Dim DS As New DataSet
           Adp.Fill(DS)
           Dim DT = DS.Tables(0)
           If DT.Rows.Count > 0 Then
               '******************************************************************************************************************************
               VoucherCode.Text = Format(GET_LAST_RECORD("ReceiptOfltems", "Voucherid") + 1, "ROF000000")
               SupplierlnVoiceCode.Text = GET_LAST_RECORD("ReceiptOfltems", "Voucherid") + 1
               '******************************************************************************************************************************
           Else
               Dim DR = DT.NewRow
               DR!VoucherCode = VoucherCode.Text
               DR!VoucherDate = VoucherDate.Value
               DR!SupplierCode = SupplierCode.Text
               DR!SupplierName = SupplierName.Text
               DR!SupplierlnVoiceCode = SupplierlnVoiceCode.Text
               DR!SupplierlnvoiceDate = SupplierlnvoiceDate.Value
               DR!SupplierInVoiceType = SupplierInVoiceType.Text
               DR!SalesTAX = Val(SalesTAX.Text)
               DR!Notes = Notes.Text
               DR!TotalQty = TotalQty.Text
               DR!TotalDiscount = Val(TotalDiscount.Text)
               DR!TotalVoucher = Val(TotalVoucher.Text)
               DR!TotalArabic = TotalArabic.Text
               DR!Status = True
               DT.Rows.Add(DR)
               Dim Cmd As New SqlClient.SqlCommandBuilder(Adp)
               Adp.Update(DT)
           End If

           BtnNew_Click(Nothing, Nothing)
           MsgBox(" تم حفظ سند التوريد فى قاعدة البيانات بنجاح", MsgBoxStyle.Information, "رسالة تأكيد")

       Catch ex As Exception
           MessageBox.Show(ex.Message, "فشل في الحفظ  ", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)

       End Try



كود :
Sub Showrecord(Vcode As String)

       DataGridView1.Rows.Clear()
       Dim Sql = "Select * From ReceiptOfltems Where VoucherCode=N'" & (Vcode) & "'"
               Dim Adp As New SqlClient.SqlDataAdapter(Sql, SQLConn)
       Dim DS As New DataSet
       Adp.Fill(DS)
       Dim DT = DS.Tables(0)
       If DT.Rows.Count = 0 Then
           MsgBox("عزيزى عفواً لم يتم العثور على السند يرجى التأكد من الرقم", MsgBoxStyle.Exclamation, "تنبيه")
       Else
           Dim DR = DT.Rows(0)

           VoucherCode.Text = CType((DR!VoucherCode), String)
           VoucherDate.Text = CType((DR!VoucherDate), String)
           SalesTAX.Text = CType((DR!SalesTAX), String)

           Notes.Text = CType((DR!Notes), String)

           SupplierCode.Text = CType((DR!SupplierCode), String)
           SupplierName.Text = CType((DR!SupplierName), String)
           SupplierInVoiceType.Text = CType((DR!SupplierInVoiceType), String)
           SupplierlnVoiceCode.Text = CType((DR!SupplierlnVoiceCode), String)
           SupplierlnvoiceDate.Text = CType((DR!SupplierlnvoiceDate), String)

           TotalQty.Text = CType((DR!TotalQty), String)

           TotalDiscount.Text = CType((DR!TotalDiscount), String)
           TotalVoucher.Text = CType((DR!TotalVoucher), String)
           TotalArabic.Text = CType((DR!TotalArabic), String)
           DR!Status = True

       End If
       Adp.Dispose()
       DS.Dispose()
       DT.Dispose()

   End Sub


الملفات المرفقة صورة/صور
   
------------------------
منكم أتعلم
------------------------

الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
ماذا يعني هذا الخطأ اثناء الحفظ - بواسطة sofiane-phy - 01-11-20, 09:49 PM


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


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