title: execute multiple update command on Excel
body: <p>I have an Excel file and I want update multiple rows in a sheet.So I write this code :</p>
  
  <pre><code>OleDbConnection cn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " + serverPath + ";Extended Properties = Excel 8.0;");
          try
          {
  
              strUpd = "";
              strUpd += "update [Data14City$] set  B_1_1 = 5 ,B_1_2 = 26 ,B_1_3 = 44 ,B_1_4 = 8  where id = 1 ";
              strUpd += " update [Data14City$] set  B_1_1 = 0 ,B_1_2 = 8 ,B_1_3 = 17 ,B_1_4 = 0  where id = 2";
              cn.Open();
              OleDbCommand cmdInsert = new OleDbCommand(strUpd, cn);
              cmdInsert.ExecuteNonQuery();
              cn.Close();
          }
          catch
          {
          }
  </code></pre>
  
  <p>and I got this error:</p>
  
  <blockquote>
    <p>Syntax error (missing operator) in query expression 'id = 1  update [Data14City$] set  B_1_1 = 0 ,B_1_2 = 8 ,B_1_3 = 17 ,B_1_4 = 0  where id = 2'.</p>
  </blockquote>
  
  <p>and I when I add <code>;</code> to this line :</p>
  
  <pre><code>strUpd += "update [Data14City$] set  B_1_1 = 5 ,B_1_2 = 26 ,B_1_3 = 44 ,B_1_4 = 8  where id = 1;";
  </code></pre>
  
  <p>I got this error:</p>
  
  <blockquote>
    <p>Characters found after end of SQL statement.</p>
  </blockquote>
  
  <p>how I can execute multiple statement in Excel?</p>
  
  <p>thanks</p>