locked
Insert/Update/Delete - Multiple table RRS feed

  • Question

  • User-1095728894 posted

    Hi,

    I am using ASP.NET Dynamic data. I have an existing data model (*.edmx) created as part of the dynamic data. I have to add another entity which would show data from multiple tables. Example

    Entity view - EmployeeDetails:

    • EmployeeID
    • EmployeeName
    • Desigination
    • Department
    • AddressLine1
    • AddressLine2

    This gets data all the data from Employee Table and one 2 columns from AddressDetails table.

    Employee-Table:

    • EmployeeID
    • EmployeeName
    • Desigination
    • Department

    AddressDetails –Table

    • EmployeeID
    • EmployeeName
    • AddressLine1
    • AddressLine2
    • City –allows null
    • PostCode –allows null

    I want to create a EmployeeDetails entity in a single page and let the user to insert/update/delete. How can I achieve it. If I create a view for the EmployeeDetails, I’ll not be able to do insert/update/delete. How can I do..

    I am a beginner, so please provide step-by-step guidance.

    Thanks in advance 

     

     

     

     

     

    Wednesday, May 1, 2013 12:52 PM

Answers

  • User-183374066 posted

    You can use transaction to insert data in multiple tables

    • Separate Employee info from your view and insert it to table
    • Similarly Separate Address info and save changes 

    see Manage Transactions in the Entity Framework

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 1, 2013 6:56 PM