A
alpha
Hi Friends,
I am using ADSI to fetch mail from microsoft excahnge server depanding as given in below query. But the problem is same query is returning differnt no of records like sometimes it returns 230, 250,... etc. Can anyone please tell what is amiss here. It is really driving be crazy?*&^%.
string DBConnection = "Provider=ADSDSOObject";
OleDbConnection conn = new OleDbConnection(DBConnection);
//Select query for getting the email Address, First Name and Last Name of the Users matching the search criteria
string query="SELECT mail,givenname,sn FROM 'LDAP://DC=xx,DC=Test,DC=xxx' WHERE objectClass='*' and givenname='"+ firstName +"*' and sn='"+ lastName+"*' and mail='"+emailAlias+"*' order by mail";
OleDbDataAdapter adapter = new OleDbDataAdapter();
conn.Open();
adapter.SelectCommand = new OleDbCommand(query, conn);
With Regards,
Alpha
I am using ADSI to fetch mail from microsoft excahnge server depanding as given in below query. But the problem is same query is returning differnt no of records like sometimes it returns 230, 250,... etc. Can anyone please tell what is amiss here. It is really driving be crazy?*&^%.
string DBConnection = "Provider=ADSDSOObject";
OleDbConnection conn = new OleDbConnection(DBConnection);
//Select query for getting the email Address, First Name and Last Name of the Users matching the search criteria
string query="SELECT mail,givenname,sn FROM 'LDAP://DC=xx,DC=Test,DC=xxx' WHERE objectClass='*' and givenname='"+ firstName +"*' and sn='"+ lastName+"*' and mail='"+emailAlias+"*' order by mail";
OleDbDataAdapter adapter = new OleDbDataAdapter();
conn.Open();
adapter.SelectCommand = new OleDbCommand(query, conn);
With Regards,
Alpha