Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 November 22nd, 2007, 08:15 AM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't get the databases to work

Hi!
I'm having some problems with the WroxUnited-application. I downloaded your updated Appendix B and followed it step by step. I'm using SQL Server 2005 Developer Edition and Visual Web Developer 2008 on Windows XP Professional.

But even though I followed the installation of both SQL Server (even named the instance 'Sql2005') and the walkthrough on how you attach the databases and so on, I still can't get it to work. When I start any of the applications that require a connection to a database, I get this error-messege:

--------------------------------------------------

Server Error in '/WroxUnited' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 149: <roleManager>
Line 150: <providers>
Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 152: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider , System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 153: </providers>


Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Conf ig\machine.config Line: 151

Version Information: Microsoft .NET Framework Version:2.0.50727.1378; ASP.NET Version:2.0.50727.1378

-------------------------------------------

And by the way if it helps, this is how my connection-string looks like in the 'web.config'-file:

--------------------------------------------

  <connectionStrings>
  <clear />
     <add name="WroxUnited"
       connectionString="Data Source=(local)\sql2005;Integrated Security=True;Initial Catalog=WroxUnited"
       providerName="System.Data.SqlClient" />
   <add name="WroxUnitedMembership"
     connectionString="Data Source=(local)\sql2005;Integrated Security=True;Initial Catalog=WroxUnitedMembership"
     providerName="System.Data.SqlClient"/>
  </connectionStrings>

-----------------------------------------

So I'm hoping you can help me. Got an excam coming up in a week or so, and I would really like to get this to work so I can get somewhere in the book.

Thank you!
 
Old November 22nd, 2007, 08:16 AM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops, sorry, I mean this is how my connection-string looks like in the 'web.config'-file:

----------------------------

  <connectionStrings>
  <clear />
     <add name="WroxUnited"
       connectionString="Data Source=FREDRIKMAIN\sql2005;Integrated Security=True;Initial Catalog=WroxUnited"
       providerName="System.Data.SqlClient" />
   <add name="WroxUnitedMembership"
     connectionString="Data Source=FREDRIKMAIN\sql2005;Integrated Security=True;Initial Catalog=WroxUnitedMembership"
     providerName="System.Data.SqlClient"/>
  </connectionStrings>

--------------------------------------
 
Old November 23rd, 2007, 03:35 PM
Registered User
 
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm, asking questions here was more useless then reading the book... and that's saying a lot...
 
Old November 23rd, 2007, 04:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look at this:

<clear />
     <add name="WroxUnited"
       connectionString="Data Source=(local)\sql2005;Integrated Security=True;Initial Catalog=WroxUnited"
       providerName="System.Data.SqlClient" />
   <add name="WroxUnitedMembership"
     connectionString="Data Source=(local)\sql2005;Integrated Security=True;Initial Catalog=WroxUnitedMembership"
     providerName="System.Data.SqlClient"/>
  </connectionStrings>


Notice how the <clear /> element clears out all existing connection strings including the default LocalSqlServer.

Your role manager then needs the LocalSqlServer connection string which it can't find.

There are a few ways to fix it:

1. Don't use <clear />

2. Put in a new LocalSqlServer connection string and point it to a database.

3. Remap LocalSqlServer in the <providers> element to an existing connection string.

I can imagine that it's frustrating if you don't get an answer right away. However, please try to be a little patient. Not everyone is watching these forums 24 x 7.... ;)

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 Ctrl+F5 don't work, F5 does work? jimboak BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 June 29th, 2008 03:46 AM
2 databases tready Access VBA 3 November 4th, 2005 04:39 PM
databases zmark Access VBA 4 September 14th, 2004 12:51 AM
How many databases can I use? FlashMan Classic ASP Databases 5 July 5th, 2004 03:26 PM
two databases, one schema defiant SQL Server 2000 3 February 4th, 2004 08:19 PM





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