fly2moon2 wrote:
Hi All,
" Object[] objs = (Object[])ie.Current;"
The error is:
"Unable to cast object of type 'RHU.RAIS.Business.Person' to type 'System.Object[]'."
How should I cast the objects to its respective (sub-)class?
portion of the code:
...
for (IEnumerator ie = q.List().GetEnumerator(); ie.MoveNext(); )
{
Object[] objs = (Object[])ie.Current;
LegalPerson lp = (LegalPerson)objs[0];
Why do You think that the ie.Current should be array/list instead of single value?
Try to replace
Object[] objs = (Object[])ie.Current;
LegalPerson lp = (LegalPerson)objs[0];
with
LegalPerson lp = (LegalPerson)ie.Current;
Gert