Error when looping listMembersOutput result

Mar 18, 2015 at 2:04 PM

Getting error when looping listMembersOutput result like below.

listMembersOutput = listMembers1.Execute();
            var Subscriberslist = listMembers1.Execute();
foreach (listMembersResults.data_item em in (IEnumerable<listMembersResults.data_item>)Subscriberslist.result)
{

}

Exception details are:

System.InvalidCastException: Unable to cast object of type 'PerceptiveMCAPI.Types.listMembersResults' to type 'System.Collections.Generic.IEnumerable`1[PerceptiveMCAPI.Types.listMembersResults+data_item]'. at Dpl.mailchimp.Schedule_Sync_Non_Members_Dynamic_VS2010.AddNonMemberToMailchimp() -- Update_Non_Member_list_in_MC Campaign Service Start. Success.
Mar 18, 2015 at 2:57 PM
ex.Message:

Unable to cast object of type 'PerceptiveMCAPI.Types.listMembersResults' to type 'System.Collections.Generic.IEnumerable`1[PerceptiveMCAPI.Types.listMembersResults+data_item]'
Mar 18, 2015 at 2:58 PM
sareenkumar wrote:
ex.Message:

Unable to cast object of type 'PerceptiveMCAPI.Types.listMembersResults' to type 'System.Collections.Generic.IEnumerable`1[PerceptiveMCAPI.Types.listMembersResults+data_item]'