Click here to Skip to main content
16,013,440 members
Home / Discussions / C#
   

C#

 
QuestionHow to create Installer that user can checked item he wannt to install (I have more 59 item whether user will install. Pin
god4k20-May-04 9:55
god4k20-May-04 9:55 
AnswerRe: How to create Installer that user can checked item he wannt to install (I have more 59 item whether user will install. Pin
Heath Stewart20-May-04 10:09
protectorHeath Stewart20-May-04 10:09 
GeneralRe: How to create Installer that user can checked item he wannt to install (I have more 59 item whether user will install. Pin
god4k20-May-04 23:52
god4k20-May-04 23:52 
GeneralRe: How to create Installer that user can checked item he wannt to install (I have more 59 item whether user will install. Pin
Heath Stewart21-May-04 3:33
protectorHeath Stewart21-May-04 3:33 
GeneralListBox with ComboBox embedded Pin
yipan20-May-04 9:44
yipan20-May-04 9:44 
GeneralRe: ListBox with ComboBox embedded Pin
Heath Stewart20-May-04 10:05
protectorHeath Stewart20-May-04 10:05 
GeneralRe: ListBox with ComboBox embedded Pin
Anonymous20-May-04 21:02
Anonymous20-May-04 21:02 
GeneralProgrammatic LDAP Queries Pin
MrEyes20-May-04 6:36
MrEyes20-May-04 6:36 
I am attempting to produce some code that performs fairly simple LDAP queries, unfortunately I can't seem to get this running. The code I currently have is :

private void GetProps()
{
	int LDAP_PORT = 636;
	string LDAP_IP = "111.222.333.444";
	string ID_CODE = "X246555";

	string ldapPath = string.Format("LDAP://{0}:{1}/o=testo/ou=Services", LDAP_IP, LDAP_PORT);
	string filter = string.Format("(&(IdCode={0})(sname=urn:this:that:something:or:other))", ID_CODE);

	DirectoryEntry de = new DirectoryEntry(ldapPath);
	//de.AuthenticationType = AuthenticationTypes.None;
	using (DirectorySearcher searcher = new DirectorySearcher())
	{
		//configure search
		searcher.SearchRoot = de;
		searcher.Filter = filter;
		searcher.SearchScope = SearchScope.Subtree;
		searcher.PropertiesToLoad.Add("prop1");  
		searcher.PropertiesToLoad.Add("prop2");
		searcher.Sort = new SortOption("prop1", SortDirection.Ascending);

		//perform search
		SearchResultCollection results = searcher.FindAll();

		//output results
		foreach (SearchResult result in results)
		{
			Console.WriteLine(result.Properties["prop1"]);
			Console.WriteLine(result.Properties["prop2"]);
		}    
	}   
}


This code is born of various docs found on the net and also within MSDN, when run it fails with this error :

Unhandled Exception: System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational

The thing is I know that the server is running and configured correctly as I can perform the same query from the same machine via OpenLDAP and this returns exactly as expected.

If anybody could help me out here I would truely appreciate it.


post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
GeneralRe: Programmatic LDAP Queries Pin
Heath Stewart20-May-04 8:08
protectorHeath Stewart20-May-04 8:08 
GeneralRe: Programmatic LDAP Queries Pin
MrEyes20-May-04 11:16
MrEyes20-May-04 11:16 
GeneralRe: Programmatic LDAP Queries Pin
Heath Stewart20-May-04 11:21
protectorHeath Stewart20-May-04 11:21 
GeneralRe: Programmatic LDAP Queries Pin
MrEyes21-May-04 4:38
MrEyes21-May-04 4:38 
GeneralRe: Programmatic LDAP Queries Pin
Heath Stewart21-May-04 4:50
protectorHeath Stewart21-May-04 4:50 
GeneralRe: Programmatic LDAP Queries Pin
MrEyes21-May-04 5:07
MrEyes21-May-04 5:07 
GeneralRe: Programmatic LDAP Queries Pin
Heath Stewart21-May-04 5:16
protectorHeath Stewart21-May-04 5:16 
GeneralCustom ToolBar Pin
BaShOr20-May-04 6:32
BaShOr20-May-04 6:32 
GeneralRe: Custom ToolBar Pin
hbk72320-May-04 7:53
hbk72320-May-04 7:53 
GeneralRe: Custom ToolBar Pin
Heath Stewart20-May-04 8:07
protectorHeath Stewart20-May-04 8:07 
GeneralRe: Custom ToolBar Pin
BaShOr20-May-04 11:46
BaShOr20-May-04 11:46 
GeneralRe: Custom ToolBar Pin
BaShOr20-May-04 22:58
BaShOr20-May-04 22:58 
GeneralXML,XSD and Dataset's with c# Pin
Rhys__66620-May-04 6:18
Rhys__66620-May-04 6:18 
GeneralRe: XML,XSD and Dataset's with c# Pin
partyganger20-May-04 6:25
partyganger20-May-04 6:25 
GeneralSTCK to a DateTime Pin
seevse20-May-04 5:40
seevse20-May-04 5:40 
GeneralRe: STCK to a DateTime Pin
Heath Stewart20-May-04 5:55
protectorHeath Stewart20-May-04 5:55 
GeneralControl to Add thumbnailed icons to Pin
lethologica20-May-04 5:33
lethologica20-May-04 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.