How do I change the connection string to point to my SQL Server running on a Windows Server 2008 machine, I know that the changes I make are in the web.config file but I'm not sure what changes to make under <connectionString> to point to my database.
I am trying to set a layered application with 3 projects; ASP.NET Web Forms, Business Logic, and Data Access Object using EF 5. I am using VS 2012 set to .NET 4.0 because my hosting is limited to 4.0. I have worked in VS 2005 with DataSets and using the ObjectData Source with BL with success. I am not clear how to get EF 5 to talk to BL. I have not worked with interfaces before. I have created the database then generated EF using database first. I then ran the DBcontext. In the Name_EF project I have the .edmx and the Name_EF.Context.tt and Name_EF.tt files. I am working in VB.Net. I can see all the .vb classes per table.
- Do I create an interface for the DBContext class?
- Do I instantiate the DBContext class in every one of my BL classes? Assuming a and Entity per table and a BL class per table.
- Do I write Linq to SQL to create insert, update, delete in a DAL class?
I just am not sure how to hook everything up with this architecture. I have Julia Lerman Entity Framework book but it is written for EF 4 and it is confusing trying to work with DBContext. My goal is to create generics so that this website can be easily scaled in the future. This is why I layered the application UI, BL, and DAO.
Until we have an opportunity to update the tutorial and code sample to EF 5, your best resource for questions like this are StackOverflow.com or the EF ASP.NET forum at http://forums.asp.net/1227.aspx .
Help us improve MSDN.
Visit our UserVoice Page to submit and vote on ideas!