title: Dynamic SQL Error SQL error code = -104 Token unknown
body: <p>Here is the error:</p>
  
  <pre><code>Dynamic SQL Error    
  SQL error code = -104    
  Token unknown - line 1, column 162    
  VALUE
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>using (FbDataAdapter da = new FbDataAdapter(@"SELECT DOC_ITEMS.ID, PRODUCTS.PRODUCTKEY, PRODUCTS.NAME, DOC_ITEMS.QUANTITY, UNITS.UNIT, DOC_ITEMS.PRICE, DOC_ITEMS.TAX, (DOC_ITEMS.PRICE * DOC_ITEMS.QUANTITY) AS VALUE
                          FROM PRODUCTS INNER JOIN
                          DOC_ITEMS ON PRODUCTS.PRODUCTID = DOC_ITEMS.PRODUCTID INNER JOIN
                          UNITS ON PRODUCTS.UNITID = UNITS.UNITID
                          WHERE (DOC_ITEMS.DOCUMENTID = @DocumentID)", con))
  
  {
      da.SelectCommand.Parameters.AddWithValue("@DocumentID", documentId);
  
      DataTable dt = new DataTable();
      da.Fill(dt);
      dataGridView1.DataSource = dt;
  
      dataGridView1.Columns["PRODUCTKEY"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["ID"].Visible = false;
      dataGridView1.Columns["NAME"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
      dataGridView1.Columns["QUANTITY"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["QUANTITY"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
      dataGridView1.Columns["UNIT"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["PRICE"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["PRICE"].DefaultCellStyle.Format = "0.00 $";
      dataGridView1.Columns["TAX"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["TAX"].DefaultCellStyle.Format = "0\\%";
      dataGridView1.Columns["VALUE"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
      dataGridView1.Columns["VALUE"].DefaultCellStyle.Format = "0.00 $";
  }
  </code></pre>
  
  <p>When I run this command through my database directly it is working ok but inside my c# code it drops this error.</p>