Hi i connect to asp page to LDAP and i displayed LDAP data into asp form i am new to asp and also LDAP
i know how to connect asp grid to database . But I dont know how to connect asp grid to LDAP
any body help me please its urgent please
This is my code i displayed LDAP data in asp form. How to display LDAP data in a drid
LDAP as database please anybody help me
private
void Button1_Click(object sender, System.EventArgs e)
{
string path = "LDAP://localhost:2389/ou=globalaci,cn=config";
//OleDbDataAdapter DA= new System.Data.OleDb.OleDbDataAdapter(path,entry);
DirectoryEntry entry =
new DirectoryEntry(path);
DirectorySearcher search =
new DirectorySearcher(entry,"(objectClass=*)");
//DataSet ds = FindUsers(search,columns,path,true);
//DataGrid1.DataSource=ds;
//DataGrid1.DataBind();
foreach(SearchResult result in search.FindAll())
{
DirectoryEntry dirEntry = result.GetDirectoryEntry();
foreach(string key in dirEntry.Properties.PropertyNames)
{
foreach( object propVal in dirEntry.Properties[key] )
{
Response.Write(key + " = " + propVal);
//Response.Write("error occured in this page");
}
}
Response.Write("----");
}
try
{
Object native = entry.NativeObject;
Response.Write("User authenticated!");
}
catch( Exception ex )
{
Response.Write(ex.StackTrace);
}
}
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).