Loading a Dataset with the results from several select queries

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

Simon Harvey

Hi everyone,

I'm wondering, is it possible to make a dataset with a number of different
datatables within it and then fill those data tables with the results from a
number of select statements?

Well actually, I know this could be done in theory so I suppose my real
question is, is there an easy way to do this without having to make the
necessary datatables by hand?

I think what I'm after is to somehow execute a number of SQL statements and
have the results plopped into a dataset (whilst automatically making the
required data tables for the resultant data)

I hope I've explained that ok.

Thanks to anyone who can help.

Kindest Regards

Simon Harvey
 
Hi Simon,

That is standard
dataadapter1 .selectcommand = new SqlCommand(query1, conn)
dataadapter1.fill(dataset1,"table1")
dataadapter1.selectcommand = new SqlCommand(query2, conn)
dataadapter1.fill(dataset1,"table2")
etc

I hope this helps,

Cor
 
Back
Top