Multiple tables in typed dataset RRS feed

  • Question

  • Hi

    Thank you for your patience, I am quite new to this. 

    using typed datasets. 

    UniversityDSTableAdapters.StudentsTableAdapter ta = new UniversityDSTableAdapters.StudentsTableAdapter();
    UniversityDS.StudentsRow r = ta.GetStudentById("111111111")[0];
    UniversityDS.DepartmentsRow row = r.DepartmentsRow;

    the first 2 rows are working fine. i get the relevant student row in line r. 

    the deparments table has a relationship to the students table through the deparment id. 

    however, when I try the last row, i get null. and i do have the relevant department in the database. 

    what do i need to do differently? 


    Saturday, August 25, 2012 11:09 PM


  • I don't use TableAdapters (I use DataAdapters instead), so I might be wrong, but the Typed DataSet Generator should have generated a DepartmentsTableAdapter also. I believe you'll need to use a method on that adapter to get your DepartmentRow.

    ~~Bonnie Berent DeWitt [C# MVP]

    • Proposed as answer by Kuacci Monday, August 27, 2012 2:27 PM
    • Marked as answer by Bob Wu-MTModerator Wednesday, August 29, 2012 6:09 AM
    Sunday, August 26, 2012 4:39 PM