Multiple Files in Data Adapter

JesseH

Active member
Joined
Feb 9, 2006
Messages
42
Location
Sugar Land, TX
Programming Experience
10+
How do I assigned multiple independent files in a data adapter SQL Statement. "Select * from BPCSFV60.APHL01" Works. I need two additional files. I tried "Select * from BPCSFV60.APHL01
Select * From BPCSFV60.GXRL01
Select * from BPCSFV60.AMHL01"

also tried putting semicolon between them. I need to do it this way because the type of join will be determined at run time. I hope to be able to code the SQL statement that I need using these three file.

Thanks in Advance
 
Is this an OleDbDataAdapter? If so then it does not support more than one SQL statement per command, so that means NO semicolons. If the type of join is to be determined at run time then the SQL code also needs to be determined at run time. You need to write VB code that will construct the appropriate SQL statement based on the particular circumstances at run time.
 
You dont.. you just create one datatable, 3 oledbcommands (one for each file) and run them consecutively (according to the order determined at runtime), ensuring that the datatable is NOT cleared at the start of each (in .net 2 this would be TableAdapter.ClearBeforeFill = false)

Also, what youre doing is not JOINing. if youre tagging results onto the end of each other, then you are UNIONing

A quick (and "cute" i've been told) explanation of the difference between union and join is that union makes resultsets grow downwards and join makes them grow sideways:

2 blocks of data: # #

When joined, end up this shape:
##

When unioned, end up this shape:
#
#



Please make sure to use appropriate terminology when communicating with other developers, in order to minimise confusion :)
 
Back
Top