locked
ListView and EntityDataSource - Display multiple tables from model RRS feed

  • Question

  • User-543471701 posted

    I am new to ASP.NET and Entity Framework. I have been looking around for good examples but I can't find any. I finally decided to ask a question as my last resort. I am hoping that someone here can help me with my problem.

    I think the solution is there, but I just can't see it. I need to display 4 tables from an Entity Framework model in a ListView.

    The model has a main table called systemUser with some basic information (userId,userFirstName, userLastName, userEmail). All of the tables have a userId. The userId is what connects all 4 tables. When I insert information I need to simultaneously insert into all 4 tables using the same userId. 

    The tables are as follows:

    systemUser:

    userId: int

    userFirstName: varchar(255)

    userLastName: varchar(255)

    userEmail: varchar(255)

    mobileSystemUsers:

    userId: int

    mobilePassword: int

    companyAccess:

    Dev: bit

    isEnabled: bit

    userId: int

    moduleAccess:

    accounting: nvarchar(2)

    sales: nvarchar(2)

    shipping: nvarvhar(2)

    When I display data I need to have something like the following:

    userId  || userFirstName || (all of systemUser) || mobilePassword || VMC || (all of companyAccess) || (moduleAccess data)

    A new systemUser should have all of the information filled out in the systemUser page. The other information can exist or be null. 

    I am using an entitydatasource. This is the first time I use it. I was able to implement this functionality using a GridView and an SQLdatasource but I need to implement this using ListView and entitydatasource. 

    When I configure the entitydatasource I am only able to select one table. 

    I also need to perform basic CRUD operations accross all tables at once. 

    How can I display all of the information from the tables in the manner that I want? 

    Tuesday, May 20, 2014 1:33 PM

Answers

All replies