title: Object is not an ADODB Record set = C# filling datatable
body: <p>I am trying to bring back records from my access DB by matching the number selected in my comboBox2 and bring back all the rows in relation to that number - this has worked fine in other projects but for some reason I keep getting the related error above - any help would be nice.. the error is on the dap.Fill(dt, typeof(Int32)); - When I take "typeof int32 out" I get this error: "SYNTAX ERROR MISSING OPERATOR IN EXPRESSIONS 'OCR = ';"</p>
  
  <p>EDIT: if it makes a difference I am using this code in this type of event: </p>
  
  <p>EDIT FIXED WIH HELP FROM ALL COMMENTS - FIXED CODE NOW ADDED AFTER CODE THAT DIDNT WORK</p>
  
  <p><strong>comboBox2_SelectedValueChanged</strong></p>
  
  <pre><code>   string strprovider = @"provider=microsoft.jet.oledb.4.0;data source=C:\Users\farrejos\Documents\inboxV2.mdb;persist security info=false";
              OleDbConnection newConn = new OleDbConnection(strprovider);
              System.Data.DataTable dt = new System.Data.DataTable();
              //DataSet ds = new DataSet();
              //ds.Tables.Add(dt);
              OleDbDataAdapter dap = new OleDbDataAdapter("Select * from ocr where OCR = " + comboBox2.SelectedText.ToString() + "", newConn);
  
              if (dap != null)
              {
                  //dap.Fill(ds);
  
                  dap.Fill(dt, typeof(Int32));
              }
  
              //dap.Fill(ds, "ocr");
  
              foreach (DataRow myRow in dt.Rows)
              {
                  textBox3.Text = myRow[4].ToString();
                  textBox4.Text = myRow[6].ToString();
              }
          }
  </code></pre>
  
  <p>FIXED CODE: </p>
  
  <pre><code>  System.Data.DataTable dt = new System.Data.DataTable();
          DataSet ds = new DataSet();
  
          OleDbDataAdapter da = new OleDbDataAdapter("Select *  from ocr where [OCR] = " + comboBox2.SelectedText.ToString() + "", newConn);
  
          da.Fill(dt);
          foreach (DataRow myRow in dt.Rows)
          {
              textBox3.Text = myRow[4].ToString();
  
              textBox4.Text = myRow[6].ToString();
          }
  </code></pre>