Issues with variable types

Hi,

I am trying to create a variable of the type DataRow as I am selecting the content of a DataTable; but I am getting the following error.

Any help would be appreciated.

Thanks!

The Select function returns an array of DataRows. You need to loop through that array and handle each row one at a time.

You can add .First, .Last, or an index to get only one of the rows and store to a DataRow, but I highly do not recommend this because there’s a chance it finds zero rows, then you are left with an error. So I suggest checking its count after you store the array of rows, like If WIList.Count > 0, which then if it’s true you can take the first or last row. Note: this is not needed for For Each loops, because it will just not do anything if the array is empty.

Although, this is also a demo exercise it appears, so it’s probably not needed to complete the exercise.

Regards.