none
Master Detail form involving more than one relation RRS feed

  • Question

  • Hi All

    I have 4 tables :

    Company {PK CompanyID, Name, FK ContactID}

    Branch {PK BranchID, FK CompanyID, Name, FK ContactID}

    Employee {PK EmployeeID, FK BranchID, Name, FK ContactID}

    Contact {PK ContactID, Address, Fax, Phone }

    The windows form application I am working on now should allow to
     1. add new   Company and it's contact details,
     2. add branch to this company and it's contact details and
     3. add new employee to the branch and create employee's contact details.

    I created typed dataset with all 4 tables. I can't work out
     
     1.if using BindingSource as DataSource for the grids and edit forms I can accomplish all 3 tasks above including contact details editing
     2.using standard TableAdapter(s) I can select only Contact rows releated to Company , Branch and Employee.
     Contact table contains other contacts as well not related to these 3 tables.


    Please help.

    tpgtotal

     

    Wednesday, August 11, 2010 10:24 AM

Answers

  • Hi All

    I have 4 tables :

    Company {PK CompanyID, Name, FK ContactID}

    Branch {PK BranchID, FK CompanyID, Name, FK ContactID}

    Employee {PK EmployeeID, FK BranchID, Name, FK ContactID}

    Contact {PK ContactID, Address, Fax, Phone }

    The windows form application I am working on now should allow to
     1. add new   Company and it's contact details,
     2. add branch to this company and it's contact details and
     3. add new employee to the branch and create employee's contact details.

    I created typed dataset with all 4 tables. I can't work out
     
     1.if using BindingSource as DataSource for the grids and edit forms I can accomplish all 3 tasks above including contact details editing
     2.using standard TableAdapter(s) I can select only Contact rows releated to Company , Branch and Employee.
     Contact table contains other contacts as well not related to these 3 tables.


    Please help.

    tpgtotal

    Yes. Beth Massi has an excellent how-to video here: http://msdn.microsoft.com/en-us/vbasic/bb643827.aspx and there's an MSDN sample here: http://msdn.microsoft.com/en-us/library/57tx3hhe.aspx

    HTH


    Rebecca M. Riordan
    Friday, August 13, 2010 1:16 PM