I'm making an intranet webapplication in ASP.NET, using Windows auth and accessing Active Directory using the LDAP-pattern found in one of the stickies on top of the LDAP-threads-list here on forums.asp.net.
public static DataSet FindUsers(string sFilter, string[] columns, string path, bool useCached);
I've got a domain controller installed by my side, and using the following in a test-application:
string filter = "(objectClass=*)";
string[] columns = new string[]{"sn", "sAMAccountName", "cn"};
string path = "LDAP:///"; DataSet ds = FindUsers(filter, columns, path, false);
dataGridView1.DataSource = ds; dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataMember = ds.Tables[0].ToString();
I fetch stuff easily, and the DataGridView is filled with it. Nice. BUT. Even if it works right now, tomorrow, or after some amount of hours (not sure how many though), I get DirectoryServicesCOMException thrown at me, saying:
"A local error has occurred.". It's triggered by the DirectorySearcher.FindAll()-function. Since it's working now, I don't have the exact output in front of me. Google gives me nada on the specific error message, and I get the error message in both my web app and the test-app I mentioned above.
Anyone with experiences on this? I've set up the domain controller myself, and started wondering if THAT is a potential error source.
Thanks in advance, Anders Øyvind