Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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 Display Modes
  #11 (permalink)  
Old January 29th, 2012, 03: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 IIS Problems

I did all of those things on page 768 of your book and I still get the following error message:

Cannot open database "PlanetWrox" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Reply With Quote
  #12 (permalink)  
Old January 29th, 2012, 03:56 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,038
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Quote:
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?
It depends. If you attach the database first, it's more or less the same. If the database is in App_Data instead, it's the same as you've been doing throughout the book.

But in order to help you, please look at my previous reply:

Quote:
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.
I need this info, together with information about your connection strings, user accounts and so on. It's probably an easy thing to fix if I was sitting at your computer, but doing this over forum posts requires a fair amount of detailed information.

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
  #13 (permalink)  
Old January 29th, 2012, 04:10 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

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.

It is windows 7 Home Professional and it is SQL Server 2008. Okay now for the iis settings it goes as follows the first row is:
Name Status Ver Managed Pipeline Identity Applications
ASP.NET 4.0 Started v4.0 Integrated ApplicationPoolIdentity 0
PlanetWrox Started v.2.0 Integrated ApplicationPoolIndentity 1

I hope this helps.
Reply With Quote
  #14 (permalink)  
Old January 29th, 2012, 04: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

Quote:
Originally Posted by vbboyd View Post
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.

It is windows 7 Home Professional and it is SQL Server 2008. Okay now for the iis settings it goes as follows the first row is:
Name Status Ver Managed Pipeline Identity Applications
ASP.NET 4.0 Started v4.0 Integrated ApplicationPoolIdentity 0
PlanetWrox Started v.2.0 Integrated ApplicationPoolIndentity 1

I hope this helps.
Oh and PS, I am just running this application on my local box and nothing more. No network connectivity or anything like that. I have detached the Planet Wrox out of the apps folder in Visual Studio and it is running or physically place in the SQL Server Folder under windows, this way I could have more direct control over the database in the SQL Server Enterprise Manager. It has its own database node in the SQL Server Enterprise Manager.
Reply With Quote
  #15 (permalink)  
Old January 29th, 2012, 04:17 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 vbboyd View Post
Oh and PS, I am just running this application on my local box and nothing more. No network connectivity or anything like that. I have detached the Planet Wrox out of the apps folder in Visual Studio and it is running or physically place in the SQL Server Folder under windows, this way I could have more direct control over the database in the SQL Server Enterprise Manager. It has its own database node in the SQL Server Enterprise Manager.
PSS and one other thing I would like to add. Is that I opened up the PlanetWrox application and then decided to make it a Virtual file folder for IIS.

I hope all this information helps.

Thanks
Vbboyd
Reply With Quote
  #16 (permalink)  
Old January 29th, 2012, 04:33 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,038
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Quote:
I hope all this information helps
A bit, but not enough.... Please be more specific, by providing information such as:
  • Exact version of SQL server (execute "select @@version" without the quotes in a query window)
  • The name of the server you use to log in to sql using management studio (. Or local or .\sqlexpress etc
  • What you mean with "detach from app_data"
  • Where the mdf resides now
  • Which account you configured in SQL Server (i assume iis apppool\something)
  • Your connection strings from web.config
  • What you mean with "make it a virtual folder"
  • How you browse to the site (e.g. The address in the browser's address bar)
  • The application pool used by your web site
  • Whether you created a new site in IIS or reused the default web site
Lots of questions, I know, but they could all be relevant.

One more thing: the PlanetWrox app pool is listed as .net 2. Maybe your site isn't using this one but a different pool with its own security context?

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
  #17 (permalink)  
Old January 29th, 2012, 05:02 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

Okay I will answer all of these question to the best of my ability

* Exact version of SQL server (execute "select @@version" without the quotes in a query window)
SQL Server 2008 and SQL Express, both run under the Enterprise Management Studio.
* The name of the server you use to log in to sql using management studio (. Or local or .\sqlexpress etc
BrendanComputer\SQLExpress
* What you mean with "detach from app_data"
I took the .mdf file that sat under App Data folder in Visual Studio 2010 and moved it to a new location.
* Where the mdf resides now
C:\ProgramFiles\MicrosoftSQLServer\MSSQL10.SQLEXPR ESS\MSSQL\DATA
* Which account you configured in SQL Server (i assume iis apppool\something) ASP.NET 4.0 is the user name and the Login Name is NT Authority\System when I went to Database User New dialog box in the Enterprise Manager of SQL Server 2008.
* Your connection strings from web.config
<add name="PlanetWroxConnectionString" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=PlanetWrox;Integrated Security=True" providerName="System.Data.SqlClient"/>
I changed the original connection string up just a bit so that I could connect to the database that runs in the different directory. Like I say I have no problems running this app. in Cassini but try running it in IIS and as they say in America: forget about it!
* What you mean with "make it a virtual folder"
Yes you know, I decided to open the folder as a virtual folder for IIS. You know you say in Visual Studio and you say file-->Open Website and up pops the Open Website dialog box and you click the little folder icon to create a virtual directory for IIS and then it pops up another dialog box and you browse the actual location that the project exists in at the directory structure and create a new virtual directory for IIS.
* How you browse to the site (e.g. The address in the browser's address bar)
* The application pool used by your web site
* Whether you created a new site in IIS or reused the default web site
I created a new website using IIS virtual directory

Lots of questions, I know, but they could all be relevant.

One more thing: the PlanetWrox app pool is listed as .net 2. Maybe your site isn't using this one but a different pool with ita own security context?
Why Versio 2.0 is anyone's guess. I have no clue on this one!
Reply With Quote
  #18 (permalink)  
Old January 29th, 2012, 05:06 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

Oh yes I am sorry I forgot to answer these questions as well:

How you browse to the site (e.g. The address in the browser's address bar)
http://localhost:58807/Chapter%2014/
* The application pool used by your web site
ApplictionPoolIdentity? Is that the answer you are looking for?

Thanks
vbboyd
Reply With Quote
  #19 (permalink)  
Old January 29th, 2012, 05:19 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

Oh yes and I am very sorry I forgot to add the way that I launch the browser is by going to the solution folder C:\WroxFiles\Chapter 14 and then I right click on it and I say browse:
and I gave you the wrong URL in the last post. I had opened it accidentally in Cassini.

Here is the actual Local URL string:

http://localhost/Chapter14wrox/Reviews/All.aspx

Sorry my bad I do appologize for that mistake on my part!

Thanks once again.
Reply With Quote
  #20 (permalink)  
Old January 29th, 2012, 05:28 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,038
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Quote:
Exact version of SQL server (execute "select @@version" without the quotes in a query window)
SQL Server 2008 and SQL Express, both run under the Enterprise Management Studio.
This is confusing. Are you using Express or the full commercial version? And which version of Express? What did @@version tell you?

Quote:
I launch the browser is by going to the solution folder C:\WroxFiles\Chapter 14 and then I right click on it and I say browse:
In Windows Explorer? Or in IIS?

Quote:
ASP.NET 4.0 is the user name and the Login Name is NT Authority\System when I went to Database User New dialog box in the Enterprise Manager of SQL Server 2008.
Again, quite confusing. Under Windows 7, you should (by default) use an account named after the application pool. E.g. something like IIS AppPool\PlanetWrox. Did you follow the steps in Chapter 19? Looks like you only did halve of them.

Quote:
<add name="PlanetWroxConnectionString" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=PlanetWrox;Integrated Security=True" providerName="System.Data.SqlClient"/>
Did you only change this one? Or did you also change the one for the Application Services? This is explained in Appendix B.

Quote:
Yes you know, I decided to open the folder as a virtual folder for IIS. You know you say in Visual Studio and you say file-->Open Website and up pops the Open Website dialog box and you click the little folder icon to create a virtual directory for IIS and then it pops up another dialog box and you browse the actual location that the project exists in at the directory structure and create a new virtual directory for IIS.
This seems to suggest you didn't follow the deployment steps in Chapter 19. Or did you? I can't really tell.

Quote:
Why Versio 2.0 is anyone's guess. I have no clue on this one!
Are you sure your site is set up for .NET 4? Chapter 19 shows you how to create an application pool that uses ASP.NET 4 and how to configure your site to use that app pool.

I think you've deployed in quite a different way than explained in Chapter 19. While there are many ways to Rome, it'll be a bit hard for me to find out what went wrong if you took a completely different approach. My recommendation would be to follow the deployment exercises in Chapter 19 along with the detailed instructions on SQL Server security in Appendix B.

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!

Last edited by Imar; January 29th, 2012 at 05:31 PM. Reason: Spelling
Reply With Quote
Reply


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
iis.msc equivalent in IIS for Win XP Pro? RealDHelix Classic ASP Basics 14 March 18th, 2007 09: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 01:19 AM



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


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