-
Write loop results to database
Hi,
I have two FOR loops in my script, with i and j variables. The sample script is like this,
For i=1 to 10
---
---
For j=i to 5
--
--
Next
---
---
Next
Now my problem is, it should write all the results of j and i to the "Datatable". How ever it is writing the results of "j" for i=1 but over writing the table when i=2.
Tried all the possiblities, like setting up to the Run Options, DataTable.SetCurrentRow(i) and DataTable.SetCurrentRow(j)...but unable to solve the problem.
can anyone help me in this?
Thank you
Question asked by visitor Kavya
-
Expert Member
Re: Write loop results to database
Hi,
Try this code. Before run this code you have to change the parameter names of A and B as i ,j respectively.Then you will get all the values of i in the first column and values of j in the second column. Reply me if u have any doubts.
For i=1 to 10
datatable.SetCurrentRow(i)
datatable(1,1)=i
For j=i to 5
datatable.SetCurrentRow(j)
datatable(2,1)=j
Next
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules