Typed Datasets - using inner joins

Last post 07-06-2009 12:25 AM by Wencui Qian - MSFT. 5 replies.

Sort Posts:

  • Typed Datasets - using inner joins

    07-03-2009, 4:44 PM
    • Member
      60 point Member
    • Ahasan
    • Member since 07-03-2009, 8:34 PM
    • Posts 15

    I am developing my first project using Typed datasets.


    Here is the problem i cant get my head round.

    I have got two datatables which are related to each other. i want to access the columns from both the tables( ie inner join). 

    How can i do that such that i have datasets which are typed.


    Filed under:
  • Re: Typed Datasets - using inner joins

    07-04-2009, 12:16 AM
    • Member
      437 point Member
    • jewelhere
    • Member since 01-18-2009, 6:55 AM
    • Dhaka, Bangladesh
    • Posts 110

    assume table1 and table2

    select table1.*,table2.* from table1 inner join table2 on table1.matchedDataField=table2.matchedDataField



    please mark as answer if this helps u.

  • Re: Typed Datasets - using inner joins

    07-04-2009, 12:18 AM
    Answer
    • Participant
      1,768 point Participant
    • nmreddy83
    • Member since 01-21-2009, 6:00 PM
    • India
    • Posts 316

    you can not apply inner join directly on resut set (Typed DataSet).

    There are few styles to acheive this

    1. You can write filter conditions based on both & select the required records from it

    2. If you use LINQ on DataSets, you can write down

    3. If you use some ORM model to get data from Server like Linq-SQL or ADO.net Entity Framework you can acheive this very easily


    ***Hope this helps you***
    ***Please mark as answer if this helps you. ***

    thank you,
    -nm reddy
  • Re: Typed Datasets - using inner joins

    07-04-2009, 12:27 AM
    • Member
      14 point Member
    • Jameel Ahmed
    • Member since 05-26-2009, 9:22 AM
    • Hyderabad
    • Posts 7

    follow this link

    http://www.c-sharpcorner.com/UploadFile/rupadhyaya/TypedDataSets12032005021013AM/TypedDataSets.aspx



  • Re: Typed Datasets - using inner joins

    07-04-2009, 7:37 AM
    • Member
      60 point Member
    • Ahasan
    • Member since 07-03-2009, 8:34 PM
    • Posts 15

    Okay, so if i cant get a typed dataset that contains the data from both tables. That makes it useless. And defeats the whole purpose of creating  typed dataset and sticking to tiered architecture.

    Taking about Linq, i havent used it much but the problem i have with it is i dont want to learn lambda expression and all. Plus people have mentioned the lack of control on your sql in this approach.Generally not really fond of the concept of OR mappers

    Doesnt that leave us with Data Access Block(enterprise library), the only problem i have with it is there should be a way to synchronise, (Buisness objects)classes with Database tables.

  • Re: Typed Datasets - using inner joins

    07-06-2009, 12:25 AM

    Hi Ahasan,

    As suggested above, it's not supported by now to write JOIN queries in typed dataset directly. The normal way is to use stored procedure instead. That means, you could write a stored procedure with JOIN queries in database, and use it in typed dataset. A custom type will be auto-generated to store the results returned in stored procedure. Please take a look at this tutorial first:

    http://www.asp.net/Learn/data-access/tutorial-68-vb.aspx

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (6 items)