Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

active directory : Referenced object has a value of 'Nothing'

  Asked By: Charlie    Date: Apr 22    Category: Asp.net    Views: 1520
  

searcher.PropertiesToLoad.AddRange(New String() {"name"})

with this code, if "name" property was not set for current user,

result.Properties("mail")(0)

is rasing error : Referenced object has a value of 'Nothing'
I Cant handle this
"Isnothing, IsDbnull, iserror" are not working


How can I discard the empty props?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Alberta Miller     Answered On: Apr 22

Use this on your properties (this is an example for the mail property)



If de.Properties.Contains("mail") Then

'use mail now

'de.Properties["mail"][0] = ...

Else

'Do something else

End If

 




Tagged: