Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET MVC 3
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 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
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 14th, 2011, 09: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, 05: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, 06: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, 06: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.
 


Thread Tools
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
Entity Framework with ACCESS? lsochia BOOK: Beginning ASP.NET 4 : in C# and VB 3 March 18th, 2011 05: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 10: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 02:32 PM



All times are GMT -4. The time now is 05:42 PM.


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