Results 1 to 3 of 3

Thread: Select from Dataset

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2014
    Posts
    362

    Select from Dataset

    I need to get data from QuickBooks datafile and combine it with SQL server data. In the old VB6 application I used to create a temporary table in SQL which I populated from QuickBooks datafile. Then I used SQL statement something like this:
    strTempSQL = "SET NOCOUNT ON; SELECT Name, #CustomerTemp.ListID, " & _
    "QBAccountCustomer.AccountID AS AccountID " & _
    "FROM QBAccountCustomer RIGHT OUTER JOIN " & _
    "#CustomerTemp ON QBAccountCustomer.ListID = #CustomerTemp.ListID " & _
    "ORDER BY #CustomerTemp.Name"

    Now I'm trying to use the dataset in which I populate 2 datatables, one from QuickBooks, another one from SQL database.
    How do I get the same data as I used to get using temp table?
    Is it possible at all? I mean, is it possible to join tables and make selections from multiple datatables in the dataset. I know about relations in the dataset, but it looks like I get data only from the first table when I use the dataset as datasource.

    Thank you

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,684

    Re: Select from Dataset

    Hello,

    It's impossible to determine why you are not populating two DataTable in the DataSet without seeing your code as SQL is only an ingredient to obtain data back.

  3. #3
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Select from Dataset

    The question itself stands fairly clear:

    "I mean, is it possible to join tables and make selections from multiple datatables in the dataset."

    LINQ can do this kinda thing, I have never done it myself however. Sample

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width