Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET MVC 3
This is the forum to discuss the Wrox book Professional ASP.NET MVC 3 by Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen; ISBN: 978-1-1180-7658-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 3 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
  #1 (permalink)  
Old September 14th, 2011, 08:27 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: North Salem, NY, USA.
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default Entity Framework Code First 4.1

I have a question about the new Professional ASP.Net MVC 3 book. Chapter 4’s use of code first Entity Framework assumes, it appears, that I have SQLEXPRESS (p.79). I use instead SQL Server 2008 R2. I checked installed programs and do not have SQL Express. (Last time I installed both I ran into problems.) I have run the program, tried to navigate to StoreManager, and get the following error:


The provider did not return a ProviderManifestToken string.


I have tried manually putting the following connection string in the web.config file:


<add name="MusicStoreDB"
connectionString="data source=.\MSSQLSERVER;Integrated Security=SSPI;initial catalog=MusicStore"
providerName="System.Data.SqlClient"/>


which is from the book, but using MSSQLSERVER instead of SQLEXPRESS. I have no idea if the string needs to be something else.


Still the same message.

I should note that I did not explicitly download EF 4.1. Could that be the problem? Are there any issues with 4.1? I really don't need it except for the exercise in the book, as I have already developed a comprehensive db for the project (database first).
  #2 (permalink)  
Old September 16th, 2011, 04:26 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: North Salem, NY, USA.
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default I Installed EF 4.1 Update 1 -- Did Not Fix

I installed Entity Framework 4.1, Update 1. Reopened the project, and navigated to StoreManager. I continued to get the same problem.
  #3 (permalink)  
Old September 16th, 2011, 05:09 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: North Salem, NY, USA.
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I got it to work with the following addition to the web.config file:

Code:
<addname="MusicStoreDB"
connectionString="data source=(local);Integrated Security=SSPI;Initial Catalog=MusicStore"
providerName="System.Data.SqlClient" />
meaning that the "data source=(local)" is what did the trick. I added it to, not replace, the other connection string in the web.config. So total connection string was:

Code:
<connectionStrings>
<addname="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<addname="MusicStoreDB"
connectionString="data source=(local);Integrated Security=SSPI;Initial Catalog=MusicStore"
providerName="System.Data.SqlClient" />
</connectionStrings>
  #4 (permalink)  
Old September 16th, 2011, 05:15 PM
Authorized User
Points: 108, Level: 2
Points: 108, Level: 2 Points: 108, Level: 2 Points: 108, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: North Salem, NY, USA.
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
Default

By the way, as mentioned earlier, I did download and install EF 4.1, Update 1, which I am assuming was also necessary for the example to work, as it is the first version with code first capabilities.

It would be nice if the book errata were updated to specify a connection string for SQLServer 2008 R2 Developers Edition, which (local) satisfied albeit in a very unsatisfying manner.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entity Framework with ACCESS? lsochia BOOK: Beginning ASP.NET 4 : in C# and VB 3 March 18th, 2011 04:07 PM
Entity Framework And MVC geomar BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 5 January 24th, 2011 04:58 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
The BeerHouse and Entity Framework docluv BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 3rd, 2008 01:32 PM





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