当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - Join 3 tables in listview ado.net webapplication entity framework

问题描述:

I am new to both ado.net and the entity framework. I am working on a web application with a login, and an administrator panel using ado.net, SQL server and the Entity Framework.

In the administrator panel, you should be able to create new users and change the role of the user (user, superuser or administrator).

I am working with the built in security tables, so there are basically 3 tables I need to show in a listview:

  • Memberships (for the emailaddress)
  • Users (for the username)
  • Roles (to update the role)

I have generated the edmx schemes for the database, but I can't figure out how to show the data and allow updating.

For now, I was using the toolbox, inserting an entityDataSource for one table, inserting a listview with the toolbox, and giving it the data from the entityDataSource. This way I could do update/insert/delete on one table. But how to do this on multiple tables? I couldn't find any useful tutorials or anything, so any tips are welcome.

网友答案:

Easiest way would be to use DynamicData together with your edmx.

However there is several tutorials on what you are trying to do

http://www.asp.net/web-forms/tutorials/getting-started-with-ef/the-entity-framework-and-aspnet-getting-started-part-2

http://www.asp.net/web-forms/tutorials/data-access/editing,-inserting,-and-deleting-data/an-overview-of-inserting-updating-and-deleting-data-cs

http://www.codeproject.com/Articles/377291/An-Introduction-to-ASP-NET-Dynamic-Data-from-a-Beg

分享给朋友:
您可能感兴趣的文章:
随机阅读: