-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: ravi
Message 1 in Discussion

hi all, I am trying to get list of employees in an organization based on the lastname, 
firstname. Things work fine if i give either firstname or lastname but stops working 
if i give lastname,firstname.     
string uname="ba,joh";
string filter="(&(anr=" + uname + 
")(|(objectCategory=organizationalPerson)(objectCategory=group)))"; 
DirectoryEntry entry=new DirectoryEntry("GC://something");
DirectorySearcher dsearch=new DirectorySearcher(entry);
dsearch.Filter=filter;
SearchResultCollection result =dsearch.FindAll(); 
foreach(SearchResult res in result)
{
           MessageBox.Show(res.Properties["cn"][0].ToString());
} 
Any idea why the code breaks?? Any help is much appreciated.. 
thanks in advance. 
Ravi

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to