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: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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
  #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
Reply With Quote
  #32 (permalink)  
Old August 4th, 2012, 02:08 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #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
Reply With Quote
  #34 (permalink)  
Old August 5th, 2012, 07:24 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
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....
Reply With Quote
  #36 (permalink)  
Old August 5th, 2012, 09:57 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #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?
Reply With Quote
  #38 (permalink)  
Old August 10th, 2012, 03:09 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #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
Reply With Quote
  #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.
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
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



All times are GMT -4. The time now is 05:52 AM.


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