Microsoft KB Archive/892464

= You receive a &quot;Syntax Error&quot; error message when you create an OracleDataAdapter control in a Visual Studio .NET 2003 Professional application =

Article ID: 892464

Article Last Modified on 1/25/2005

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Professional Edition

-





SYMPTOMS
When you create an OracleDataAdapter control in a Microsoft Visual Studio .NET 2003 Professional application, you may receive one of the following error messages:

Syntax Error: Found 'FROM' inside an expression.

Syntax Error: Expecting identifier or quoted identifier.



CAUSE
This behavior occurs when one of the following conditions is true:
 * The select SQL query statement has more than one FROM clause.
 * The select SQL query statement contains a select subquery.
 * The MissingSchemaAction property of the OracleDataAdapter control is set to MissingSchemaAction.AddWithKey before you call the Fill method.



WORKAROUND
To work around this behavior, use both of the following methods:
 * Manually create the code for the select command. Do not use the Data Adapter Wizard to create the data adapter.
 * Do not set the MissingSchemaAction property to MissingSchemaAction.AddWithKey before the application calls the Fill method on the dataset.



Steps to reproduce the behavior
 Add the Northwind database tables in an Oracle database (version 8.1.7). In Visual Studio .NET 2003 Professional, create a Windows application. Add an OracleDataAdapter control to the form. The Data Adapter Configuration Wizard starts. Click Next. On the Choose Your Data Connection page, create your connection, and then click Next. On the Choose a Query Type page, click Use SQL statements.</li> On the Generate the SQL Statements page, click Advanced options, click to clear the Generate Insert, Update and Delete statements check box, and then click OK.</li> In the Generate the SQL Statements box, type the following statement, and then click Next:

SELECT EmployeeID, lastname, OrderID FROM Employees, (SELECT * FROM ORDERS) DERIVEDTBL

Note You receive the following error message:

Syntax Error: Expecting identifier or quoted identifier

</li> Remove the sub-select query from step 8. Notice that the query works correctly.</li> In the code properties of the OracleSelectCommand.CommandText method, change the select query to include the sub-select query.</li> Right-click the OracleDataAdapter control, and then click Yes in the Regenerate Parameters dialog box.

Note You receive the same error message that you received in step 8.</li></ol>

Keywords: kbprb KB892464

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.