Last post Aug 24, 2017 10:18 AM by Eric Du
Aug 24, 2017 02:01 AM|cowasaki|LINK
I am trying to loop a dynamic object to get key value values.
string s =item.items.value;
string s2 = item.items.value;
--I don't know how to populate these variables. The code throws an error- for each statement cannot operate on variables of type object....
many thanks for any help.
Aug 24, 2017 02:57 AM|markfitzme|LINK
I believe what it's trying to tell you is the object doesn't implement IEnumerable, so you can't really use foreach. And an object is singular, so it wouldn't be able to operate on it unless it was some type of collection.
Aug 24, 2017 10:18 AM|Eric Du|LINK
According to your needs, please check the following link:
How to loop through List<dynamic>:
Iterate through dynamic object: