title: OLEDB Excel single quote error
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/755621/oledb-writing-excel-cell-without-leading-apostrophe">OLEDB, Writing Excel cell without leading apostrophe</a>  </p>
  </blockquote>
  
  
  
  <p>I'm using this code:</p>
  
  <pre><code>System.Data.OleDb.OleDbConnection MyConnection;
  System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
  string sql = null;
  MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\\test_excel.xls';Extended Properties=Excel 8.0;");
  MyConnection.Open();
  myCommand.Connection = MyConnection;
  
  sql = "CREATE TABLE EmployeeData (Id char(255), Name char(255), BirthDate date)";
  myCommand.CommandText = sql;
  myCommand.ExecuteNonQuery();
  
  sql = "INSERT INTO EmployeeData (Id, Name, BirthDate) values ('AAA', 'Andrew', '12/4/1955')";
  myCommand.CommandText = sql;
  myCommand.ExecuteNonQuery();
  
  MyConnection.Close();
  </code></pre>
  
  <p>The code works but my problem is single quote (see image below)</p>
  
  <p>How to fix?</p>
  
  <p><a href="http://www.freeimagehosting.net/newuploads/e32f9.jpg" rel="nofollow noreferrer">example of problem http://www.freeimagehosting.net/newuploads/e32f9.jpg</a></p>