hi all
i am doing a web site with single sign on technique. I am getting the error "COMExcepti on (0x80072020): An operations error occurred" while executing the statement
foreach (SearchResult AdObj in objsearch.FindA ll())
I can run the application in the local server but not by remote client. so please tell me the solution for it.
the code is:
strAppPath = "LDAP://myServer/CN=user,CN=user s,DC=sample,DC= testprjs,DC=com "
public bool authenticateUse r(string userName, string password)
{
DataTable dtDBUser = new DataTable("User InDB");
dtDBUser.Column s.Add("UName");
dtDBUser.Column s.Add("Pwd");
dtDBUser.Column s.Add("UDomain" );
DataRow dr;
dr = dtDBUser.NewRow ();
dr[0] = "gdhanasekaran" ;
dr[1] = "dhana";
dr[2] = "chennai";
dtDBUser.Rows.A dd(dr);
DirectoryEntry deRoot = new DirectoryEntry( strAppPath);
DirectorySearch er objsearch = new DirectorySearch er();
objsearch.Filte r = "(objectClass=u ser)";
objsearch.Searc hScope = SearchScope.Sub tree;
string strCN = "";
foreach (SearchResult AdObj in objsearch.FindA ll())
{
strCN += //System.Director yServices.Activ eDirectory.Doma in.GetCurrentDo main().Name + "\n" +
AdObj.Propertie s["SAMAccountName "][0] + "\n";
if (userName == Convert.ToStrin g(AdObj.Propert ies["SAMAccountName "][0]))
{
if (dtDBUser.Selec t("UName = '" + userName + "' ").Length > 0)
{
return true;
}
else
{
return false;
}
}
}
return false;
}
Thanks in Advance.
Regards,
Dhanasekaran.G
i am doing a web site with single sign on technique. I am getting the error "COMExcepti on (0x80072020): An operations error occurred" while executing the statement
foreach (SearchResult AdObj in objsearch.FindA ll())
I can run the application in the local server but not by remote client. so please tell me the solution for it.
the code is:
strAppPath = "LDAP://myServer/CN=user,CN=user s,DC=sample,DC= testprjs,DC=com "
public bool authenticateUse r(string userName, string password)
{
DataTable dtDBUser = new DataTable("User InDB");
dtDBUser.Column s.Add("UName");
dtDBUser.Column s.Add("Pwd");
dtDBUser.Column s.Add("UDomain" );
DataRow dr;
dr = dtDBUser.NewRow ();
dr[0] = "gdhanasekaran" ;
dr[1] = "dhana";
dr[2] = "chennai";
dtDBUser.Rows.A dd(dr);
DirectoryEntry deRoot = new DirectoryEntry( strAppPath);
DirectorySearch er objsearch = new DirectorySearch er();
objsearch.Filte r = "(objectClass=u ser)";
objsearch.Searc hScope = SearchScope.Sub tree;
string strCN = "";
foreach (SearchResult AdObj in objsearch.FindA ll())
{
strCN += //System.Director yServices.Activ eDirectory.Doma in.GetCurrentDo main().Name + "\n" +
AdObj.Propertie s["SAMAccountName "][0] + "\n";
if (userName == Convert.ToStrin g(AdObj.Propert ies["SAMAccountName "][0]))
{
if (dtDBUser.Selec t("UName = '" + userName + "' ").Length > 0)
{
return true;
}
else
{
return false;
}
}
}
return false;
}
Thanks in Advance.
Regards,
Dhanasekaran.G
Comment