Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2013, 01:25 PM
Registered User
 
Join Date: Feb 2013
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default Entity Framework issue

Hi,
To practice on what I learn, I create another Database website using the ADO.NET Entity Framework. I do exactly the same as in Chapter 14 (create the edmx file and delete the 2 files with ".tt" extension) with the below code:
using (MyEntities myEnt = new MyEntities())
{
.....
}

When I click the word "MyEntities" and press Ctrl+., the select list don't have the option "using MyModel", only got the "Generate class for 'MyEntities'". When I manually type the "using MyModel;" at the top, it gave an error: "The type or namespace name 'MyModel' could not be found (are you missing a using directive or assembly reference?)".

Any idea what might be the cause and how to solve this.

Thanks and have a nice day.

Last edited by weixing; April 26th, 2013 at 01:28 PM.. Reason: add more details
 
Old April 26th, 2013, 01:37 PM
Registered User
 
Join Date: Feb 2013
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,
I try again and now it's work. After some testing, I think I miss out the step to change the "Code Generation Strategy property from None to Default".

Have a nice day.





Similar Threads
Thread Thread Starter Forum Replies Last Post
using entity framework 5 misuk11 BOOK: Professional ASP.NET Design Patterns 1 February 25th, 2014 05:23 PM
Entity Framework vbboyd BOOK: Beginning ASP.NET 4.5 : in C# and VB 5 January 18th, 2013 11:48 AM
Entity Framework v1 issue Olin BOOK: Professional ASP.NET MVC 2 2 January 24th, 2011 04:49 PM
Switching To entity framework luckystar BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 July 31st, 2009 09:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.