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 OriginalGriff 400
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 95
4 Maciej Los 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2014
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