Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Finding a threshold from a column

$
0
0
Hi guys,

I need to run through a column and find a value which arbitrarily, fall below the threshold of 0.05. The column of data has a negative gradient i.e its value falls down lower until it reaches its base, but I just wanted the point where it starts to reach that threshold value. So here's my code:

Code:

For a = 20 To ds.Tables(0).Rows.Count - 1

            If ds.Tables(0).Rows(a).Item(1) < 0.05 Then
                k = ds.Tables(0).Rows(a).Item(0)
            End If

        Next

TextBox3.Text = k.ToString

However, when I run the code, the threshold value didn't appear, instead it returned the value of the last row, which, of course, is also below 0.05. Please enlighten me.

Thanks & Cheers,
Vizier87.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>