title: reading excel file to print in c# windows form based on a condition
body: <p>if i have the following data in my excel file,note that it may or may not have data from A-Z columns</p>
  
  <pre><code>  A     B      C
  1 1     97     testing
  2 5     102    test
  3 8     42     tessst
  </code></pre>
  
  <p>on a c# windows form there is a single test box that prompts the user for a row number,if they enter a row number of <code>1</code> then it must bring back only that single row.</p>
  
  <p>what i attempted</p>
  
  <pre><code>private void btnGetRow_Click(object sender, EventArgs e)
  {
      var RowNumber =  txtRowNumber.Text;
      var path = "C:\\Book1.xlsx;";          
  
      if (txtRowNumber.Text == string.Empty || Convert.ToInt32(RowNumber) == 0)
      {
          MessageBox.Show("Please enter a digit &gt; 0 ");
      }
      else
      {
          string con = " Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;";
          using (OleDbConnection connection = new OleDbConnection(con))
          {
              connection.Open();
              OleDbCommand command = new OleDbCommand("select * from [Product$] where F1=Rownumber ", connection); // hear it must filter from the textbox,which it doesnt do so,it gives an error 
             using (OleDbDataReader dr = command.ExecuteReader())
              {
                  while (dr.Read())
                 {
                    //here im not sure how to get the columns from A-Z
                    //send data to the printer
                  }
              }
  
          }
  
          Console.WriteLine(RowNumber);
      }
  }
  </code></pre>