Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi this is my code. I need to go through the for loop to get the value from a datatable for each row and compare the value. Example the datatable out put is
total Percentage

1192 0.8
1964 0.3
1964 0.1

So it should compare 0.8 minus with 0.3. If the reminder greater than 0.3 Then it should be minus again with the 0.3. So the bal is 0.5 minus 0.3. So how actually do it in a loop.

For Each TesterShutdown As DataRow In tblRawTesterShutdown.Rows
                            For Each ShutdownCriteria As DataRow In tblShutdownCriteria.Rows
                                If TesterShutdown.Item("E_FIELD") = ShutdownCriteria.Item("E_CODE") _
                                And TesterShutdown.Item("F_FIELD") = ShutdownCriteria.Item("F_CODE") _
                                And TesterShutdown.Item("G_FIELD") = ShutdownCriteria.Item("G_CODE") _
                                And TesterShutdown.Item("FAMILY") = ShutdownCriteria.Item("FAMILY") Then
                                    If tblRawTesterShutdown.Rows.Count > 1 Then

                                        Dim FirstPer As Double = 0
                                        Dim SecPer As Double = tblRawTesterShutdown.Rows(1).Item("PERCENTAGE")
                                        Dim BalPer As Double = 0.0

                                        <big>For c As Integer = 0 To tblRawTesterShutdown.Rows.Count - 1
                                   
                                          
                                        Next</big>
                                    End If
                                End If
                            Next
                            Exit For
                        Next


Thanks in advance.Need it urgently.Thanks again
Posted
Updated 8-Apr-13 17:11pm
v2

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