DetailsView and Parent-Child Tables - Inserting Rows

When you have parent-child tables and want to use DetailsView to edit data, how do you do it using SqlDataSource?

For example, if you have Person and Employee table (where Employee is the child table and Person is the parent table - the employee gets from the person). Person P_ID First Name Last Name Date of Birth Employee E_ID P_ID EmployeedID Title HireDate

  • The SQL statement returns all information for the employee (first and last name, DOB, EmployeeID, Title, HireDate).
  • The user should be able to edit and insert the employee with one DetailsView instead of 2 DetailsViews (one for Person and one for employee).
  • When pasting, you first need to create a record for the person and then the ID assigned to the employee)

So how can this be done? 1. Using SQLDataSource 2. Using DataSet

+1


source to share


1 answer


Does this answer your question: http://msdn.microsoft.com/en-us/library/aa581796.aspx ?



+1


source







All Articles