iOS Question Counting Rows with resultset

tufanv

Expert
Licensed User
Hello,

I know we must use nextrow method with b4i but i cant count the number of rows with it . Is there an easy vay to count rws of a result set ?

TY
 

tufanv

Expert
Licensed User
I am using
for i = 0 to cursor4.rowcount-1 and i cant figure out how to use count in query with this purpose . Can you show a little example for my for next ( or can i use do while resultset.nextrow loop instead of for i=0 to rowcount-1 ? )
 

tufanv

Expert
Licensed User
You don't need the count at all.
The correct way is:
B4X:
Dim rs As ResultSet = SQL.ExecuteQuery(...)
Do While rs.NextRow
Log(rs.GetString("Col1"))
Loop
rs.Close
Erel Do I have to close the resultset everytime. For example if i use rs1 for 2 different queries do i have to close and use again unlike the cursor ?
 
Top