DataRow ItemArray Length Incorrect
This is the same project about which I have been asking most of my questions lately. I am using data returned from a stored procedure as shown below. I extract a data table proxy from the Get Table method of the stored procedure query. Then I extract a data row collection proxy from the data table's Rows property. The row collection count property is used to set the upper limit of the for loop.
In the for loop, I pass the loop's index number value to the data row collection's Get Item by index number method to work with the data from one row of the data rows collection. I extract a data row proxy from the result of the row collection get item method to loop over each column of the data row to set the values of the variables used later in the automation. Initially, I was using the item array count property to set the upper limit for looping through the data columns. The query in this case returns eleven (11) data columns. So I added a switch with eleven cases plus the Default case. I was not using the default case at first. I figured I wrote the query and the query had eleven columns, so I only needed eleven cases. I would soon find out my hypothesis was flawed.
This is the same project about which I have been asking most of my questions lately. I am using data returned from a stored procedure as shown below. I extract a data table proxy from the Get Table method of the stored procedure query. Then I extract a data row collection proxy from the data table's Rows property. The row collection count property is used to set the upper limit of the for loop.
In the for loop, I pass the loop's index number value to the data row collection's Get Item by index number method to work with the data from one row of the data rows collection. I extract a data row proxy from the result of the row collection get item method to loop over each column of the data row to set the values of the variables used later in the automation. Initially, I was using the item array count property to set the upper limit for looping through the data columns. The query in this case returns eleven (11) data columns. So I added a switch with eleven cases plus the Default case. I was not using the default case at first. I figured I wrote the query and the query had eleven columns, so I only needed eleven cases. I would soon find out my hypothesis was flawed.
While debugging the automation, I noticed the loop did not move to the completed node after the final variable value was set. I added a loop break and connected it to the default case for the switch and placed a breakpoint on the connector. When I resumed debugging, the automation stopped at the breakpoint on the default case.
When I check the item array length property, the value was twenty (20), not eleven as expected. How is this possible? This particular query returns fifteen (15) rows and each row has eleven columns. I tried to use the data table columns count property, but its value is also twenty.
How do I get the column names and values of column indices 11 through 19? And from where is the data coming?