DevPinoy.org
A Filipino Developers Community

>>> First two to make 3 wins! <<<

Dataset receiving multiple tables from a stored procedure.

rated by 0 users
This post has 1 Reply | 1 Follower

Top 500 Contributor
Posts 3
Points 60
DOBius Posted: 11-06-2007 7:05 PM

Can anyone help me this my problem?

stored proc:

---------------------------------- 

select * from table1

select * from table2

select * from table3

-----------------------------------

recieving code ............

            Dim DataAdapter As SqlDataAdapter = New SqlDataAdapter()
            DataAdapter.SelectCommand = Command

            Dim ds As DataSet = New DataSet
            Con.Open()
            DataAdapter.Fill(ds, "Table")

 

my problem is that ds(dataset) only recieve one table result... i believe that datasets could contain multiple tables.. 

 

thanks in advance 

Did you remember the day you remembered yourself?
  • | Post Points: 20
Top 10 Contributor
Posts 1,967
Points 39,325

DOBius:

Can anyone help me this my problem?

stored proc:

---------------------------------- 

select * from table1

select * from table2

select * from table3

-----------------------------------

recieving code ............

            Dim DataAdapter As SqlDataAdapter = New SqlDataAdapter()
            DataAdapter.SelectCommand = Command

            Dim ds As DataSet = New DataSet
            Con.Open()
            DataAdapter.Fill(ds, "Table")

 

my problem is that ds(dataset) only recieve one table result... i believe that datasets could contain multiple tables.. 

 

thanks in advance 

The problem is this line : DataAdapter.Fill(ds, "Table")

remove the "Table" part and it should work. basically what happens is that since you are assigning a name to the Datatable on the Dataset it creates only 1 table with the name Table.

 

HTH

devpinoy sig

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS

Copyright DevPinoy 2005-2008