(Thanks for the help on my previous question! Great help!)
I’m trying to go through the Data manipulation lesson and I get an error. In it, I’m supposed to read from an csv file, then use a For Each to get the first and last name. The read and assign work, including filtering to members only.
However, the foreach does not work. Specifically, the row(“First”).ToString call gives me an error of Method Name expected. I’m following the example as written but it’s not working there.
Just like @carmen mentioned, you need to use the for each row activity when you are looping through data tables… For Each is used for a different purpose…
Thanks for the replies. I figured out my issues. It was a strange syntax error.
I could use the standard For Each. Further, I used the For Each with a dataTable object and that worked fine. I’m curious about the For Each Row and how it differs.
The problem was syntax. I had row(“First”).ToString. I had to change that to row[“First”]. That wasn’t enough as it didn’t like it and row[“First”].ToString also gave me a problem. So, the final thing that worked for me was (string)row[“First”].