locked
I forgot to access the Item index value RRS feed

  • Question

  • User-1542376292 posted

    Here is the final result I am getting

     

    Last Name First Name Email Address
    System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection
    System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection
    System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection
    System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection
    System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection System.DirectoryServices.ResultPropertyValueCollection

     

    Any idea what the problem is?

    Thanks

    Thursday, February 2, 2006 10:58 AM

All replies

  • User1354132231 posted
    I split this post from the other one because I don't want to drag an ages old post to the top again.  Please create a new thread and do not piggyback on other, but unrelated threads.

    What you are seeing is the exactly the same as if you tried a ToString() operation on any reference type (assuming they did not overload the method).

    Do you see from this output that you have a ResultPropertyValueCollection? Collections require that you access their Item through either an Index or Value type of property.  In this case, you must use the index -

    //returns first item in collection as string.
    SearchResult.Properties["someProperty"][0].ToString()
    Thursday, February 2, 2006 1:43 PM