09-11-21, 08:00 AM
(09-11-21, 02:09 AM)Anas Mahmoud كتب : ضع تفاصيل اضافية
رسالة الخطأ والكود المستخدم
تم حل المشكلة
المشكله من التنسيق في المتغيرات
هذا الكود السابق
كود :
Dim sum_Debtor As Decimal
For Each mRow As DataGridViewRow In DG.Rows
If Not String.IsNullOrEmpty(mRow.Cells("column1").FormattedValue.ToString) Then
If IsNumeric(mRow.Cells("column1").Value) Then
sum_Debtor += Convert.ToInt32(mRow.Cells("column1").Value)
End If
End If
Nextو هذا بعد التصحيح
كود :
Dim sum_Debtor As Decimal
For Each mRow As DataGridViewRow In DG.Rows
If Not String.IsNullOrEmpty(mRow.Cells("column1").FormattedValue.ToString) Then
If IsNumeric(mRow.Cells("column1").Value) Then
sum_Debtor += Convert.ToDecimal(mRow.Cells("column1").Value)
End If
End If
Nextفالتحويل كان ToInt32 بينما كان Decimal
فينتج خطأ عن ذالك التنسيق
