A
Arvind P Rangan
Hi,
I working on Active Directorys, and am trying to retrive some values for
certain attribute.
No problem till now, but some attributes don't have values like
Title,Second Name,etc...
When i try to compare those values with isNothing or IsDbNull its still
raising System.NullReferenceException.
How to capture this before going to exception.
I need to check its nothing then display some message else the available
value.
Code
Dim res As SearchResult
Try
If res.Properties("title")(0) Is Nothing Then
Response.Write("No title")
Else
Response.Write(res.Properties("title")(0))
End If
Catch es As Exception
Response.Write(es.ToString)
End Try
Thanks
Regards
Arvind.
I working on Active Directorys, and am trying to retrive some values for
certain attribute.
No problem till now, but some attributes don't have values like
Title,Second Name,etc...
When i try to compare those values with isNothing or IsDbNull its still
raising System.NullReferenceException.
How to capture this before going to exception.
I need to check its nothing then display some message else the available
value.
Code
Dim res As SearchResult
Try
If res.Properties("title")(0) Is Nothing Then
Response.Write("No title")
Else
Response.Write(res.Properties("title")(0))
End If
Catch es As Exception
Response.Write(es.ToString)
End Try
Thanks
Regards
Arvind.