Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 March 25th, 2011, 12:59 PM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default Page 483 error

I'm using the VB.NET code:

Using myEntities As New PlanetWroxEntities()

Even after using Imports PlanetWroxModel it tells me that PlanetWroxEntities is not defined, the suggested fix is to use:

Using myEntities As New PlanetWroxEntities1()

- which seems to work fine. Is this correct because the book doesnt state the 1?
 
Old March 25th, 2011, 01:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Alex,

Looks like you tried to add the model multiple times before you got one that worked.

When you add a new model using the Wizard, VWD adds a connection string to web.config named after the model. E.g. you get something like PlanetWroxEntities as a connection string.

If you then follow the same steps again you get a new connection with a sequential number. This in turn causes the model name to change. A few ways to fix it, depending on how important you find this:

1. Leave everything as is and work with PlanetWroxEntities1. Works, but may not be as nice from an aesthetic perspective

2. Delete the model files and the connection strings from web.config and redo your steps

3. Rename the connection string in web.config by removing the 1. Then use Find and Replace in Files to update the name for the model as well. Make sure you also update the EDMX file and its code behind file which may mean manually editing the XML for the EDMX file.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 26th, 2011, 05:09 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks Imar, I did try to insert it before but no table diagrams came up so I copied the DB over again and it worked. I think I'll leave it as it is as long as I now understand what happened.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Page 483 tariq BOOK: Beginning ASP.NET 4 : in C# and VB 10 September 14th, 2010 09:35 PM
Chapter 14 (Page 483) CSS Declaration jsymons BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 11 September 18th, 2009 07:14 AM
Errata: Page 483 drupalmeister BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 June 22nd, 2009 01:32 AM
Ex9_03, page 483 & '571974 Code from the book' Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 2 September 23rd, 2006 01:29 PM





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