Last post Dec 03, 2009 09:10 AM by KBShah
Nov 19, 2009 10:59 AM|KBShah|LINK
I am querying active directory data for an app.
For all the AD attriutes that I am looking for I get the correct information
string DistinguishedName = sr.Properties["DistinguishedName"].ToString();
gives me the correct distinguished name
However for the company info
string company = cast(sr.Properties["company"].ToString();
I get the System.Byte as the value for the string company
I do not understand why I am getting the data type of the object for company wheras for all other objects I am getting the value of the AD attribute...
Appreciate any help!
Dec 03, 2009 08:55 AM|israa17|LINK
hi, maybe the company info is a binary data (image , text file , office suites , pdf , etc...) or of type byte , so u have to first read the binary data and specify its content type for the browser to understand as :
Response.ContentType = "text/plain";
Dec 03, 2009 09:10 AM|KBShah|LINK
My issue has been resolved. The main concern was that I was not getting the error on one server and was getting it on another server. So i had to add impersonation in my web.config and that resolved the issue!