title: Writing to a blank excel sheet with ADO.NET
body: <p>I am trying to use ADO.NET to connect to and write to an excel file. I have created a blank file with the default excel sheets (I have also tried with a custom sheet.)</p>
  
  <p>For some reason I am unable to write a full row of data to the sheet. If I create a new sheet it works fine, however then I have too many sheets and I am unable to delete any sheets.</p>
  
  <p>Is there something special you need to do to write a row of data to a blank sheet?</p>
  
  <p>I try to do:</p>
  
  <pre><code>path= the path including my file. 
  
  connString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=NO;\"", Server.MapPath(path));
  
  dbCmd.CommandText = "Update  [Sheet1$] Set F1 = 'Col1', F2 = 'Col2', F3 = 'Col3', F4 = 'Col4'";
  dbCmd.ExecuteNonQuery(); 
  </code></pre>