LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2004, 05:22 AM
tyngDev tyngDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 tyngDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Retrieve LDAP attribuild

Hi Expect,

can anyone please help me. i using the following

using (DirectoryEntry de = new DirectoryEntry(ConfigurationSettings.AppSettings[ldappath] + ConfigurationSettings.AppSettings[ldapbase]))
using (DirectorySearcher searcher = new DirectorySearcher())
{
searcher.SearchRoot = de;
searcher.Filter = "(cn=Tze Yang*)";//*" + this.txtSearch.Text.ToString() + "*)";
searcher.SearchScope = SearchScope.Subtree;
searcher.PropertiesToLoad.Add("mail"); searcher.PropertiesToLoad.Add("givenname"); searcher.PropertiesToLoad.Add("jobtitle");
SearchResultCollection results = searcher.FindAll();

foreach (SearchResult result in results)
{
ResultPropertyCollection props = result.Properties;
string Email = props["mail"][0].ToString();
string Name = props["givenname"][0].ToString() + " " + props["postaladdress"].ToString();
string jobTitle = props["jobtitle"][0].ToString();
.........
}

to queri the LDAP server. Happen that if i query using eudora, i can get the attribuild for the jobtitle. but when i using the above code and try to get the jobtitle. it throw error. and i check thru all the return record (total 58), the jobtitle is not there. but i am sure that this i-Planet LDAP contain this attribuild. Please help.

Reply With Quote
  #2  
Old October 8th, 2004, 04:22 AM
arknius arknius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Stuttgart
Posts: 50 arknius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 sec
Reputation Power: 9
Send a message via ICQ to arknius
do you mean "attribute" instead of "attribuild"?

If you want to know, whether the attribute is supported you your LDAP Server you have to look in the Servers Shema.

Reply With Quote
  #3  
Old October 8th, 2004, 04:36 AM
tyngDev tyngDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 tyngDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Please help

Hi,

Oops....wrong spelling.
back to the topic. i am sure that the attribute is exist seeing that i can use others query method to get it. just happen that when i use the directory service, it is not there. so i really don't understand. please help

Reply With Quote
  #4  
Old October 8th, 2004, 04:44 AM
arknius arknius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Stuttgart
Posts: 50 arknius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 sec
Reputation Power: 9
Send a message via ICQ to arknius
Where do you bind as an user with administration rights? I can't see the connection line. If you bind a anonymous, you probabaly don't have the rights for searching the wanted attribute.

ps: are you german?

Reply With Quote
  #5  
Old October 8th, 2004, 04:48 AM
tyngDev tyngDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 3 tyngDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Please help

Hi,

i am not german.
nop. this server do not require admin login. i use others connection also did not authenticate but it can work. thanks for your advice in advance.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Retrieve LDAP attribuild

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap