title: SQLite error near "WITH"
body: <p>i try to update data with this code</p>
  
  <pre><code>SQLiteConnection conn = new SQLiteConnection("Data Source=" + filename + ";Version=3;");
  public static string filename = CGlobalVar.CurrentMissionFolder + @"\DBase\BMS_Ops";
  
  conn.Open();
  
  SQLiteCommand scom = new SQLiteCommand(conn);
  scom.CommandText = "WITH NewNames(SatuanID, ParentAddr, IpSlave, row_Num) AS (select SatuanID, ParentAddr, IpSlave, (SELECT COUNT(*) FROM SatuanKawan AS t2 where ParentAddr = " + satuan.wOpsAddr.ToString() + " and t2.SatuanID &lt;= t1.SatuanID) AS row_Num From SatuanKawan AS t1 where ParentAddr = " + satuan.wOpsAddr.ToString() + " ) update SatuanKawan set IpSlave = '" + udpSlave + "' WHERE SatuanID IN ( SELECT SatuanID FROM NewNames WHERE row_Num = " + j + ")";
  scom.ExecuteReader();
  conn.Close();
  </code></pre>
  
  <p>but when execute the code is error</p>
  
  <pre><code>SQLite error
  near "WITH": syntax error
  </code></pre>
  
  <p>when i try to execute the query in sqlite browser it works fine.</p>
  
  <p>how to fix that?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the value öf scom.CommandText after variables</p>
  
  <pre><code>WITH NewNames(SatuanID, ParentAddr, IpSlave, row_Num) AS
    (SELECT SatuanID,
            ParentAddr,
            IpSlave,
       (SELECT COUNT(*)
        FROM SatuanKawan AS t2
        WHERE ParentAddr = 1
          AND t2.SatuanID &lt;= t1.SatuanID) AS row_Num
     FROM SatuanKawan AS t1
     WHERE ParentAddr = 1)
  UPDATE SatuanKawan
  SET IpSlave = '192.168.1.101'
  WHERE SatuanID IN
      (SELECT SatuanID
       FROM NewNames
       WHERE row_Num = 1)
  </code></pre>
  
  <p>or i use wrong system.data.sqlite.dll?</p>
  
  <p>i confused why this query in c# error, but works when i running database manually in sqlite browser after variables.</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>like laalto say. when try debugging in my app this version return 3.7.10 , different when im debugging with sql browser is version value 3.8.4.2, so im try to search newest version and i found it in <a href="http://docs.nuget.org/docs/start-here/installing-nuget" rel="nofollow">http://docs.nuget.org/docs/start-here/installing-nuget</a> and install package system data sqlite version 3.8.5 in my app and it works.  </p>