开发者

Configure EntityDataSource from a DAL?

开发者 https://www.devze.com 2023-02-19 13:32 出处:网络
I am learning Entity Framework 4. I have a simple ASP.NET (Web Form) application.I created a separate project for my DAL.In the DAL, I have created开发者_如何学运维 an entity called Sites.

I am learning Entity Framework 4.

I have a simple ASP.NET (Web Form) application. I created a separate project for my DAL. In the DAL, I have created开发者_如何学运维 an entity called Sites.

Now, I want to bind that to a form using an EntityDataSource control but it isn't visible. What am I doing wrong?

I made sure to reference the DAL.dll in the web project and include it in the code behind for the form. It's been a while since I've been in ASP.Net :-)

Thanks.


Possible reason: The class Sites in your DAL project is not public. You have only ...

class Sites
{
    ....
}

... which means that the class is internal (identical with internal class sites). Then you can reference this class only within the DAL assembly but not in another assembly. You need public class Sites.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号