none
Auto generate relations on DataSet RRS feed

  • Question

  • Hello,  I have a task where I want to fill dataset with multiple tables from database (MSSQL Server) and with their relationships.

    And my question is: Is possible to auto generate relations between tables in dataset, if relations was set up already on database level? and if it is possible then how?

    Wednesday, February 8, 2017 2:32 PM

All replies

  • Hi Kovacs Levente,

    Thank you for posting here.

    For your question is more related to dataset, I will move it to ADO.NET DataSet forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give a solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 9, 2017 8:09 AM
  • Hi Kovacs Levente,

    >>And my question is: Is possible to auto generate relations between tables in dataset, if relations was set up already on database level? and if it is possible then how?

    DataSet - represents in memory the data that can contain multiple DataTable objects that can be related with DataRelation objects.

    DataRelation object is passed to either the GetChildRows or GetParentRow method. It is the DataRelation object that determines what related table to query in order to return the related data associated with the GetChildRows or GetParentRow method call.

    For more information, please refer to:

    https://msdn.microsoft.com/en-us/library/aa289510(v=vs.71).aspx

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 10, 2017 3:23 AM
    Moderator