Click here to Skip to main content
13,046,464 members (70,568 online)
Rate this:
Please Sign up or sign in to vote.
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
                                    End If
                                End If
                            Exit For

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2017
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