Wrox Programmer Forums
| 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
 
Old January 27th, 2012, 10:35 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default IIS failure

When I tried to run your web app as a virtual directory under IIS I get the following error code message:

Cannot open database "PlanetWrox" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.
 
Old January 27th, 2012, 10:40 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default I forgot to mention

I forgot to mention, that the application runs fine when I run it in Cassini, but as soon as you deploy to IIS as part of virtual directory, and try to run it that way it throws an permissions error.
 
Old January 28th, 2012, 03:26 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

Hi there,

It's a permissions issue. The account used by the web server is not allowed to access the database. Check out Chapter 19 and Appendix for more details.

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!
 
Old January 28th, 2012, 10:20 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

I followed all the directions in your book on pages 718 thru 722 and I got the following error when I tried to browse this website:

Cannot open database "PlanetWrox" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
 
Old January 29th, 2012, 02:55 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

Those steps deals with the file system, right? You error suggest a database error. The account used by the webserver is not allowed to access the database. Did you check out Appendix B?

If you did and it still doesnt't work I need more information such as the version of Windows and SQL Server you're using, how you set up the site in IIS, how you configured the database and so on.

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!
 
Old January 29th, 2012, 12:25 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by Imar View Post
Those steps deals with the file system, right? You error suggest a database error. The account used by the webserver is not allowed to access the database. Did you check out Appendix B?

If you did and it still doesnt't work I need more information such as the version of Windows and SQL Server you're using, how you set up the site in IIS, how you configured the database and so on.

Imar
Are you talking specifically about the steps that you outlined in your book in Appendix B starting on page 768? Just to point me in the right direction are those the steps in need to follow?
 
Old January 29th, 2012, 01:26 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

Yes, that's what I was referring to. The appendix shows you how security in SQL Server works, and then shows you how to attach and configure your database and then use it from a web application running under IIS.

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!
 
Old January 29th, 2012, 02:46 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Okay I will do that

I will follow those instructions. I just don't know if doing some of the things that are in the examples in chapter 19 of the book will have messed up my IIS settings or not. Thanks for the info.
 
Old January 29th, 2012, 03:00 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

The error you're getting can be fixed with the proper configuration as explained in Appendix B. And if not, you can always start over with Chapter 19 ... :-)

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!
 
Old January 29th, 2012, 03:15 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default The IIS problem

Quote:
Originally Posted by Imar View Post
The error you're getting can be fixed with the proper configuration as explained in Appendix B. And if not, you can always start over with Chapter 19 ... :-)

Imar
The problem is that the databases are sitting on SQL Express and not full blow SQL Server. Do you configure SQL Express the same way you configure SQL Server?




Similar Threads
Thread Thread Starter Forum Replies Last Post
iis.msc equivalent in IIS for Win XP Pro? RealDHelix Classic ASP Basics 14 March 18th, 2007 08:28 PM
Help in Assertion failure abdelkader Visual C++ 0 December 30th, 2003 10:43 AM
CreateObject error on IIS 4 but not IIS 5 timtom Classic ASP XML 1 December 5th, 2003 01:26 PM
Catastrophic failure cyberbhaskar Classic ASP Databases 0 September 16th, 2003 12:19 AM





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