Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0 For
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 8-Apr-13 17:28pm
Edited 8-Apr-13 18:11pm
v2

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

  Print Answers RSS
0 Maciej Los 184
1 Sergey Alexandrovich Kryukov 154
2 Sascha Lefévre 120
3 Abhinav S 104
4 Jörgen Andersson 75
0 Sergey Alexandrovich Kryukov 6,628
1 OriginalGriff 6,298
2 Peter Leow 2,534
3 Maciej Los 2,437
4 Abhinav S 2,378


Advertise | Privacy | Mobile
Web03 | 2.8.150414.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100