Subquery Problem in Query Builder

J

Joe_Reggae

In Visual Studio 2003 I'm not able to generate a dataset or tablemappings
for an Oracle DataAdapter as long as the SQL in the DataAdapter contains
subqueries (I'm using the Microsoft OLE DB Provider for Oracle and have an
Oracle 8 database). The query works just fine, though, and returns correct
data.

Here's the query ...


SELECT Equipment.*,

(SELECT Equip_IDs.ID_NUMBER
FROM Equip_IDs
WHERE Equip_IDs.ID_TYPE = 'TAG NUMBER' AND Equipment.Equip_ID =
Equip_IDs.Equip_ID) AS TAG

FROM Equipment


Good data is returned both running the query in the Query Builder and by
right-clicking the DataAdapter to "Preview Data."

Nevertheless, when closing the DataAdapter Configuration Wizard I get this
error ...

"There were errors configuring the data adapter."

and when trying to generate a dataset I'm told ...

"Syntax Error: found 'FROM' inside an expression"

Attempting to open the DataAdapter's TableMappings collection, this error
occurs ...

"Unable to retrieve the schema from the database table. Source column
mapping information will not be available. Would you like to continue?"

Anyone recognize what I'm doing wrong here? Appreciate any suggestions.
 
M

Miha Markic [MVP C#]

Hi Joe,

I don't think that wizard is that powerful.
I would rather configure it manually.
 
C

CT

It might not be powerful, but quite often (when it works that is...<g>) it
can save you a lot of time and be used to create the intial query which you
then edit manually. Save time is the key word here if you ask me.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Miha Markic said:
Hi Joe,

I don't think that wizard is that powerful.
I would rather configure it manually.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Joe_Reggae said:
In Visual Studio 2003 I'm not able to generate a dataset or tablemappings
for an Oracle DataAdapter as long as the SQL in the DataAdapter contains
subqueries (I'm using the Microsoft OLE DB Provider for Oracle and have
an
Oracle 8 database). The query works just fine, though, and returns
correct
data.

Here's the query ...


SELECT Equipment.*,

(SELECT Equip_IDs.ID_NUMBER
FROM Equip_IDs
WHERE Equip_IDs.ID_TYPE = 'TAG NUMBER' AND Equipment.Equip_ID =
Equip_IDs.Equip_ID) AS TAG

FROM Equipment


Good data is returned both running the query in the Query Builder and by
right-clicking the DataAdapter to "Preview Data."

Nevertheless, when closing the DataAdapter Configuration Wizard I get
this
error ...

"There were errors configuring the data adapter."

and when trying to generate a dataset I'm told ...

"Syntax Error: found 'FROM' inside an expression"

Attempting to open the DataAdapter's TableMappings collection, this error
occurs ...

"Unable to retrieve the schema from the database table. Source column
mapping information will not be available. Would you like to continue?"

Anyone recognize what I'm doing wrong here? Appreciate any suggestions.
 
M

Miha Markic [MVP C#]

Hi Carsten,

CT said:
It might not be powerful, but quite often (when it works that is...<g>) it
can save you a lot of time and be used to create the intial query which you
then edit manually. Save time is the key word here if you ask me.

Indeed. But there are other, IMO better, ways.
For example, do check my templates for CodeSmith. I bet that they can save
you even more time. :)
http://www.rthand.com/default.aspx?Page=2&SubPage=1#4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top