title: C# LDAP against LDS
body: <p><br>I'm trying to resolve this problem but I cannot get this to work.<br>
  <strong>The Question</strong></p>
  
  <blockquote>
    <p>What is wrong with my query?</p>
  </blockquote>
  
  <p><strong>The Code</strong></p>
  
  <pre><code>private static void ExecuteQuery()
          {
              string sDomain = "10.12.14.165:389";
              string sDefaultOU = "CN=GeneralUsers,CN=Company,DC=Server,DC=LDS,DC=LOCAL";
              string sServiceUser = "myUser";
              string sServicePassword = "myPassword";
  
  
              DirectoryEntry ldapEntry = new DirectoryEntry("LDAP://" + sDomain + @"/" + sDefaultOU,
                                                            sServiceUser,
                                                            sServicePassword);
  
              DirectorySearcher ldapSearcher = new DirectorySearcher(ldapEntry);
              //Error Occurs here
              SearchResultCollection ldapResult = ldapSearcher.FindAll();
          }
  </code></pre>
  
  <p><strong>The Error</strong></p>
  
  <blockquote>
    <p>@ SearchResultCollection ldapResult = ldapSearcher.FindAll();<br>
    <strong>Exception:</strong> There is no such object on the server.</p>
  </blockquote>
  
  <p><strong>Attention</strong></p>
  
  <blockquote>
    <p>The Object DOES Exist</p>
  </blockquote>