01-11-17, 07:42 AM
كود :
Dim SS As String = "عام"
dtcustm.Rows.Clear()
Dim CMD As New OleDbCommand("select ID as [رقم العميل],fullname as [اسم العميل],tel as [التليفون],adress as [العنوان],cus_pa as [الرصيد],cus_typ as [الحاله] from tab_cus where fullname <> @PASS", con)
CMD.Parameters.AddWithValue("@date", SS)
con.Open()
dtcustm.Load(CMD.ExecuteReader)
dgvcust.DataSource = dtcustm
'أمر الانتقال الى السطر الأول
For Each r As DataGridViewRow In dgvcust.Rows
If Val(r.Cells(4).Value) = 0 Then
Me.dgvcust.CurrentRow.Cells(5).Value = "خالص"
ElseIf Val(r.Cells(4).Value) < 0 Then
Me.dgvcust.CurrentRow.Cells(5).Value = "دائن"
Me.dgvcust.CurrentRow.Cells(4).Value = Me.dgvcust.CurrentRow.Cells(4).Value.ToString.Replace("-", "")
Else
Me.dgvcust.CurrentRow.Cells(5).Value = "مدين"
End If
Next
con.Close()فضلا منكم المساعده