Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 25th, 2011, 12:59 PM
Authorized User
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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?
Reply With Quote
  #2 (permalink)  
Old March 25th, 2011, 01:13 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
Old March 26th, 2011, 05:09 AM
Authorized User
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:30 PM.


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