locked
How to capture array retrieved by the RetrieveMultipleResponse method? RRS feed

  • Frage

  • hello everyone!

    I have requested a response for my query using the RetrieveMultipleResponse service. How can I extract the array of BusinessEntities from the resultant instance.

     

    I have pasted a snippet of my code,

    QueryExpression exp = new QueryExpression();
                    string[] attributes = new string[] { "fullname" };
                    ColumnSet cset = new ColumnSet(attributes);
                    exp.ColumnSet = cset;
                    exp.EntityName = EntityName.contact.ToString();

                    RetrieveMultipleRequest req = new RetrieveMultipleRequest();
                    req.Query = exp;


                    RetrieveMultipleResponse res = (RetrieveMultipleResponse)service.Execute(req);
                    BusinessEntity[] barray = res; *********************PROBLEM IS HERE*********************
                   
                    foreach (BusinessEntity b in barray)
                        Console.WriteLine((b as contact).fullname);

    thanking you in advance,

     

    Sebastian

    Montag, 16. August 2010 15:06

Antworten