Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
| 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 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
  #31 (permalink)  
Old August 4th, 2012, 01:48 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

So if you don;t mind and can spend few minutes then can I send you the hosting details to you and can you check for the issue?
If you agree, then I will send details on your email id...

Many thanks
  #32 (permalink)  
Old August 4th, 2012, 02:08 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I typically don't do this. I am a book author, not your hosting support guy ;-)

In this case, since you're struggling with this for so long, let's give it a try. If you send me the details, I'll take a look. Could be today, tomorrow, or next month when I have the time though.

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!
  #33 (permalink)  
Old August 5th, 2012, 12:10 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Thanks Imar for your kind acceptance of my request.
I've sent you details...

Thanks
  #34 (permalink)  
Old August 5th, 2012, 07:24 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Fixed...... http://sophiahuja.somee.com/Member/Default.aspx

It had nothing to do with EF. However, your EF test page uses a master page that in turn uses Profile:

Code:
if (Profile.IsAnonymous == true || Profile.Photo == "")
{
  Image1.ImageUrl = "~/Images/NoPicture.gif";
}
Profile tries to look at a database configured in Web.config. You had none, and thus it defaults to .\SqlExpress which doesn't exist on your hosting server. I added a profile provider to web.config:

Code:
<profile>
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider" connectionStringName="ConnectionString" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
  <properties>
    <add name="Photo" />
  </properties>
</profile>
And now it works.

This is why I asked: are you sure EF is causing the problem? In cases like this, reducing the problem to the absolute minimum code required to reproduce the problem always helps. You could have created an EF test page without a master page and the minimum code needed to access EF. Then you would have found that EF works which hopefully would have led you to the Profile in the Master Page.

Cheers,

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!
The Following User Says Thank You to Imar For This Useful Post:
sophia (August 5th, 2012)
  #35 (permalink)  
Old August 5th, 2012, 08:05 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
It had nothing to do with EF. However, your EF test page uses a master page that in turn uses Profile:
Oh my my, you are Angel, you made my day. You just looked and problem got solved. I have no words to say thanks. You are my roll model programmer, this is power of experience and passion about what you learn...

Many thanks....
  #36 (permalink)  
Old August 5th, 2012, 09:57 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome. Glad it's working now...

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!
  #37 (permalink)  
Old August 9th, 2012, 08:25 PM
Authorized User
Points: 113, Level: 2
Points: 113, Level: 2 Points: 113, Level: 2 Points: 113, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Posts: 27
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hello Imar,

As I progress with the book, I keep testing my stuff online to see what needs to be changed in my web.config file.

So after being done with the Security chapter I decided to upload my website again:
http://www.jdlferreira.somee.com/

My only issue now are logins, any login attempt returns an SQL error, and I'm guessing that it's a problem with my providers:
Code:
<membership>
          <providers>
              <clear />
              <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
          </providers>
      </membership>
I'm thinking it might be something to do with connectionStringName="LocalSqlServer" , I tried a few things, like changing it to orangefreshConnectionString1 (my original SQL connection string), but that turned into a "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'." error. Any ideas on where to go with this?
  #38 (permalink)  
Old August 10th, 2012, 03:09 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Check out Appendix B that talks about this. Your database is not configured for ASP.NET. You either need to upload / attach your ASPNETDB database to your host as well and configure it appropriately, or run aspnet_regsql (page 771) to merge the ASP.NET Membership and Roles into your own database and then reconfigure the application.

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!
  #39 (permalink)  
Old August 14th, 2012, 10:48 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
I'm thinking it might be something to do with connectionStringName="LocalSqlServer"
yes it is, you need to update your connection string with your production string.

Quote:
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
You might be generating script with only schema not the schema+data.
Try to generate script with schema and data and run this script against your db.
It should work now....

Thanks
  #40 (permalink)  
Old August 22nd, 2012, 06:23 AM
Authorized User
Points: 113, Level: 2
Points: 113, Level: 2 Points: 113, Level: 2 Points: 113, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Posts: 27
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Check out Appendix B that talks about this. Your database is not configured for ASP.NET. You either need to upload / attach your ASPNETDB database to your host as well and configure it appropriately, or run aspnet_regsql (page 771) to merge the ASP.NET Membership and Roles into your own database and then reconfigure the application.

Hope this helps,

Imar
Cheers Imar, I've now managed to use the aspnet_regsql tool.

I was wondering here though, I now have only one database using the one connection string: "PlanetWroxConnectionString1", this has all the tables I created with the book (Genres, Reviews etc), it also now holds all the membership services too. What is the best way to import the contents of ASPNETDB into this database though? Seeing as we created Admin roles and whatnot, I'd like to import all of those settings we created in the book.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing Connection String in web.config TeaDrinkingGeek BOOK: Beginning ASP.NET 4 : in C# and VB 1 March 14th, 2011 10:42 AM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
setting connection string in the web.config ACE2084 ADO.NET 2 January 6th, 2005 04:33 PM
Database Connection with Web.Config RPG SEARCH Classic ASP Databases 7 July 26th, 2004 06:10 PM
Variable Path in web.Config Connection String? ElPato General .NET 4 June 21st, 2004 05:44 PM





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