title: Read Data from XLSX in c#
body: <p>I am new to c# and am trying to read an XLSX file in c# with the following code:</p>
  
  <pre><code>string Connection = "Provider=Microsoft.ACE.OLEDB.12.0;DataSource=c:\\Temp\\source.xlsx;Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=1\";";
  
  //code to read the content of format file 
  OleDbConnection con = new OleDbConnection(Connection);
  OleDbCommand command = new OleDbCommand();
  
  DataTable dt = new DataTable();
  OleDbDataAdapter myCommand = new OleDbDataAdapter("select * from [Tabelle1$]", con);
  
  myCommand.Fill(dt);
  Console.Write(dt.Rows.Count);
  </code></pre>
  
  <p>I get t a correct count from the output, but I have 2 more questions:</p>
  
  <p>1.How do make a select where statement (how to access the rows)? </p>
  
  <pre><code> select * from [Tabelle1$] where A = '123' (A being an existing Excel row)
  </code></pre>
  
  <p>will throw an error mentioning wrong parameters...</p>
  
  <p>2.can anyone supply me with a tutorial link or short sample how to access the data?</p>