473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

False While Statement

I have the following while statement in my code

While dataReader.read(
‘Do Stuffâ€
End Whil

The dataReader contains 19 rows of data, but the while loop continues and fails on a 20th loop. I have attached a debugger and watched the value of dataReader.read go from True to False after the 19th loop. For some strange reason the loop continues after "While dataReader.read" becomes false

Any fixes, tips, or suggestions are greatly appreciated

Ty Millwe
tm******@yahoo.co

--Actual Code-

Dim dr2 As SqlDataReade
dr2 = SqlHelper.ExecuteReader(oConn, CommandType.Text, sql

While dr2.Rea

If Not IsDBNull(dr2("hpa")) The
Me.dg.Items.Item(i).Cells(5).Text = CStr(dr2("hpa")
Els
Me.dg.Items.Item(i).Cells(5).Text = Nothin
End I

If Not IsDBNull(dr2("comments")) The
Me.dg.Items.Item(i).Cells(9).Text = CStr(dr2("comments")
Els
Me.dg.Items.Item(i).Cells(9).Text = Nothin
End I

CalcHLP(i
CalcATL(i
'CalcHB(i
i = i +
End Whil

Nov 18 '05 #1
1 1175
How about slightly changing the code like this

Do While datareader.read(
' do somethin
End While
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: drs | last post by:
I just upgraded my Python install, and for the first time have True and False rather than 1 and 0. I was playing around at the command line to test how they work (for instance, "if 9:" and "if...
4
by: renderman | last post by:
Hi, I looked through a computergenerated code because I had to edit something manually. I found this line: <xsl:when test="''='FALSE'"> I don't get what this means.
15
by: F. Da Costa | last post by:
Hi all, Following two sniperts of code I'm using and getting very interesting results from. ..html <tr id="1" class="segment" open="false"> This is the segment under 'investigation' ..js
9
by: Honus | last post by:
In a .Net application, given a C++ dll with methods called by a C# GUI Assume (x&y) is FALS the following code in the C++ dll, when called from the C# interface bool theMethod(unsigned int...
22
by: Paminu | last post by:
As I remember if(1) evaluates to true and all other numbers including 0 evaluate to false. But where do I find out about this for sure?? I have looked through K&R, all the C for dummies books...
10
by: tony | last post by:
Hello!! I have some demo programs written in C# and they have this construction "" see below. I haven't seen this before so what does it mean ? public bool ShowDropDownButtons { get {...
30
by: Jason | last post by:
I am fairly new to ASP--I have been using it about 2 months. I did these tests (below), and it doesn't make sense to me. False is equal to 0, and that's fine. True should be equal to 1, but it's...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
8
by: Peter Afonin | last post by:
Hello, I'm using Javascript in ASP.NET application to check whether at least one checkbox in datagrid has been checked. If validation fails, the user gets a warning. If he clicks OK, the form is...
40
by: nufuhsus | last post by:
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.