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

  • Thread starter Thread starter Mario Rodriguez
  • Start date Start date
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
 
Back
Top