The code shown below is designed to increment through each row in a database table. Correct the error in the code. For intRecordCount = 0 To datPeople.Rows.Count ' Processing statements Next

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter11: Sql Server Databases
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

The code shown below is designed to increment through each row in a database table. Correct the error in the code.

For intRecordCount = 0 To datPeople.Rows.Count

' Processing statements

Next

Expert Solution
Step 1

We have to increment through each row in a database table, for that we can use any of the following methods.

Method 1:
We can use built-in functions when the related packages gets imported and also by a try block. In such way we can iterate through rows as per the following coding.

Coding:

TableIterator<Row> iter = dataPeople.tableIterator(key, null, null);
Try
 {
    while (iter.hasNext())
 {
        Row row = iter.next();
        // info
    }
}
 Finally
 {
    if (iter != null)
 {
        iter.close();
    }
}

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT