title: How to handle invalid characters in OleDb Excel import?
body: <p>I am importing excel files to my application and sometimes worksheets column names have "$" sign in it. I receive this Exception:</p>
  
  <pre><code>System.Data.OleDb.OleDbException was unhandled
  Message=''6um$'$' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.
  </code></pre>
  
  <p>In this sheet "6um$" is a column name.</p>
  
  <p>This is my code:</p>
  
  <pre><code>OleDbConnection con = new System.Data.OleDb.OleDbConnection(connectionString);
  OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter(
      "select * from [" + worksheetName + "$]", con);
  
  con.Open();
  System.Data.DataSet excelDataSet = new DataSet();
  cmd.Fill(excelDataSet);
  con.Close();
  </code></pre>
  
  <p>Any ideas how to handle this situation?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I thought the problem was having $ in column name. But turns out, The problem is having $ sign in worksheet name! </p>