Simple SQL/DataSet question

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi everyone,

I was wondering if it is possible, to use SQL to return more than one table
at a time into a dataset. I only know the basics of SQL and so I'm not sure
if I'm just asking a stupid question. But, I'm not proud! :-)

I'm using Ado.net and I'm wanting to load a DataSet object with several
independent tables. (For those who arent ADO.net programmers, a DataSet can
hold multiple tables and the relationships and contraints attached to
them. - Sort of like a mini-database as I understand it)

My question is - using SQL, will I have to execute several statements and
load the dataset manually, or is there some magic SQL command that I can use
to get more than one table back at once and magiacally into the dataset? I'm
using an access database so I can't use any stored procedures as I
understand it. Don't know of that makes any difference though.

Your advice as always is greatly appreciated.

Thanks

Simon
 
It's up to your database..if it supports batch queries than you can. You
might have say six queries seperated by ; for your command text. Then,
when you call dataset fill, each query (provided it's a select query) will
come back as a different table in the dataset, numbered in order that they
appear in the command text. Oracle, SQL Server, Sybase, all the big ones
support it. Access on the other hand doesn't to the best of my knowledge.

HTH,

Bill
 
Back
Top