error searching Active Directory using OleDB - DB_E_NOTABLE(0x80040E37)

M

Mario Rodriguez

Hi I am trying to search activeDirectory through OLEDB and I am getting the
exception like this DB_E_NOTABLE(0x80040E37) at OleDbDataAdapter.Fill
method.

My code look like this.

OleDbConnection activeConn = new OleDbConnection("Provider=ADSDSOObject");
string cmdString = "SELECT * FROM 'LDAP://DC=domain name, DC=COM' WHERE
objectClass='OU'"; OleDbDataAdapter custDA = new OleDbDataAdapter(); DataSet
dataset = new DataSet(); custDA.SelectCommand = new OleDbCommand(cmdString,
activeConn); try { custDA.Fill(dataset, "OU"); } catch(Exception e) {
Console.WriteLine("Exception while filling the dataset: "+e); }

Can anybody see anything wrong here? Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top