title: OLEDB with updating excel cells
body: <p>I wrote this method to update an excel cell:</p>
  
  <pre><code>public void update(string fileName, string sheetName)
  {
     string connString = connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath(fileName) + ";Extended Properties=Excel 12.0";
  
  try
  {
     OleDbConnection oledbConn = new OleDbConnection(connString);
  
     oledbConn.Open();
  
    OleDbCommand cmd = new OleDbCommand("UPDATE ["+sheetName+"$B5:B5] SET F1=17", oledbConn);
  
    cmd.ExecuteNonQuery();
  
    oledbConn.Close();
  }
  catch(Exception ex)
  {
    Debug.Write("Error: " + ex.Message);
  }
  }
  </code></pre>
  
  <p>I called it like this:</p>
  
  <pre><code>update("test.xls", "test");
  </code></pre>
  
  <p>The B5 cell is available in "test" sheet, but the value never gets updated.</p>
  
  <p>I even tried with this one: </p>
  
  <pre><code>UPDATE ["+sheetName+"$B5:B5] SET F1='17'
  </code></pre>
  
  <p>and I always got this exception: No value given for one or more required parameters.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks in advance. </p>