in Search
     
Latest post 11-06-2007 7:41 PM by keithrull. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-06-2007 7:05 PM

    • DOBius
    • Top 500 Contributor
    • Joined on 10-25-2007
    • Roxas City, Philippines
    • Posts 3
    • Points 60

    Dataset receiving multiple tables from a stored procedure.

    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
  • 11-06-2007 7:41 PM In reply to

    • keithrull
    • Top 10 Contributor
    • Joined on 08-08-2005
    • San Diego, CA
    • Posts 1,956
    • Points 39,255

    Re: Dataset receiving multiple tables from a stored procedure.

    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)