title: "No value given for one or more required parameters" Accessing Excel Spreadsheet
body: <p>its my first time to access and read an excel file (xlsx) with c#..
  i am having problem and the error was: No value given for one or more required parameters</p>
  
  <p>below is my code:</p>
  
  <pre><code>    private void button5_Click(object sender, EventArgs e)
      {
          string ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Class Schedules.xlsx;Extended Properties=""Excel 12.0;HDR=NO;""";
          string ExcelQuery;
          ExcelQuery = "SELECT A1 FROM [Sheet1$]"; 
          OleDbConnection ExcelConnection = new OleDbConnection(ConnectionString);
          ExcelConnection.Open();
          OleDbCommand ExcelCommand = new OleDbCommand(ExcelQuery, ExcelConnection);
          OleDbDataReader ExcelReader;
          ExcelReader = ExcelCommand.ExecuteReader(); //error happens here
  
          while (ExcelReader.Read())
          {
              MessageBox.Show((ExcelReader.GetValue(0)).ToString());
          }
          ExcelConnection.Close();
      }
  </code></pre>
  
  <p>since this is my first time, im just trying to read the content of A1, below is my excel file:</p>
  
  <p><img src="https://i.stack.imgur.com/XEy6T.png" alt="enter image description here"></p>
  
  <p>but running the code would give me an error: No value given for one or more required parameters.</p>