When you have parent-child tables and you wish to use a DetailsView to edit the data how do you do it using a SqlDataSource?
For example, if you have a Person and an Employee table (where an employee is the child table and the Person is parent table - an employee derives from a person). Person P_ID FirstName LastName DOB Employee E_ID P_ID EmployeedID Title HireDate
- The SQL statement returns all the information for the employee (First and Last Name, DOB, EmployeeID, Title, HireDate).
- User should be able to edit and insert an employee using a single DetailsView, instead of 2 DetailsView (one for Person and the other for employee)
- When inserting, the record for person should be created first and then the ID assigned to employee)
So how does one go about doing this? 1. Using a SQLDataSource 2. Using a DataSet