Click here to Skip to main content
15,886,833 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have datagridview that is already connected in my database using oledb. And it also displaying the count query and it also compute the results that are in critical level.

I have Active, Spare, Defective items.

Sample in Datagridview:

Active 1000
Defective 10
Spare 50

It is already compute the level of the defective. But if the defective is zero or none. It becoming like this:

Active 1000
Spare 50

It counts the "Spare" as the "Defective". I want to show in Datagridview that the defective is "0" if it is not existed. To prevent the computation of spare as defective.

What I have tried:

Dim Activeqty As Integer
        Dim Spareqty As Integer
Dim defectqty As Integer

Activeqty = DataGridView1.Rows(0).Cells(1).Value.ToString()
defectqty = DataGridView1.Rows(1).Cells(1).Value.ToString()
Spareqty = DataGridView1.Rows(2).Cells(1).Value.ToString()


Activepercentage = Activeqty * 0.1
If Actprcnt > defectqty Then
    CriticalReport.Listview.Items.Add("CRITICAL")
End If
Posted
Updated 4-Feb-18 5:18am
Comments
Ralf Meier 2-Feb-18 8:44am    
I'm not sure what your real question is ...
Do you want to know how to detect the different contents (or not-contents) ...?
Or something quiet different ...?
Richard Deeming 2-Feb-18 10:32am    
You need to fix your query. We can't do that for you, because you haven't shared it with us.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900