p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > BOOK: ASP.NET 2.0 MVP Hacks and Tips
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 MVP Hacks and Tips
This is the forum to discuss the Wrox book ASP.NET 2.0 MVP Hacks and Tips by David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear; ISBN: 9780764597664

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 MVP Hacks and Tips section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2006, 12:02 PM
Registered User
 
Join Date: Sep 2006
Location: New York, NY, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vsakunala
Default Chapter 2: Connectionstrings externalfile approach

Hello guys,

I am reading this book and tried the external file approach for connection settings.

I moved the connectionstring settings to a file "LocalConnectionStringSettings.config" and its contents are

<connectionStrings >
        <add name="XYZ" connectionString="Data Source=DBS1;Initial Catalog=mydatabase;uid=XXX;pwd=" providerName="System.Data.SqlClient"/>
    <add name="ABC" connectionString="Data Source=DBS2;Initial Catalog=mydatabase;uid=;pwd=" providerName="System.Data.SqlClient" />
</connectionStrings>

and changed my web.config as follows

<connectionStrings configSource="..\LocalConnectionStringSettings.con fig" />


When I compile I get the following error

"C:\Project\Web App\Web.Config(17): Build (web): The configSource attribute is invalid.: The configSource '..\LocalConnectionStringSettings.config' is invalid. It must refer to a file in the same directory or in a subdirectory as the configuration file."


Please let me know what/where I am going wrong.

Thanks
Vijay sakunala
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 1st, 2007, 10:03 PM
Registered User
 
Join Date: Sep 2007
Location: Houston, TX, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just had the same error. I notice that this post is from September of last year. No comment yet?

I accommodated by keeping the external file at the same level as my web.config, which is still some improvement, but I have to be careful not to update the root of the web by just sending all files. now I have to make sure to exclude the localhost file.

Would love to know if it was just a misprint in the book, or if possibly there is a setting somewhere that needs changing. Or what.

We are at a shared host, our web is one level down from the main site. We should have full access to the directory above us, the main site, so I wouldn't expect it to be permissions. Still, we get the same problem reported in the previous post.

Anyone know the answer to this one?

Thanks in advance.

Incidentally, this particular book (ASP.NET 2.0 MVP Hacks and Tips is the most useful book I've found so far, period. I like things that are "down to the metal" or way up high where the environment just does everything for you. Most ASP and .NET books are somewhere in the "messy middle", where they don't tell you everything you need to know to make things do what you really want them to do, and the environment they're talking about is not completely wired enough to just do everything for you. This books tells you in very few words some very essential things to make excellent use of the features that you knew were there but didn't quite know quite enough to tap into. Thanks, guys!)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old March 5th, 2008, 01:39 PM
Registered User
 
Join Date: Mar 2008
Location: Lindenhurst, IL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It looks like you are trying to place the "LocalConnectionStringSettings.config" file in a directory above where the web.config file is located. Web sites (and web applications cannot access files above the root of the website. You have to place the external config file in the same directory as the web.config that is pointing to the external config file.

In other words:
1. move "LocalConnectionStringSettings.config" to the same directory as the web.config
2. your connection strings setting should look like:
<connectionStrings configSource="LocalConnectionStringSettings.config " />

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Will this be a good approach with XML? mike_remember ASP.NET 1.0 and 1.1 Professional 0 October 23rd, 2007 10:11 AM
Need help with approach rickyc1 Classic ASP Databases 4 July 14th, 2005 11:26 AM
Datasets - what is the best approach? Dave Stumbles VB Databases Basics 0 January 12th, 2005 05:21 PM
what is the common approach for it? thanks Robin1 Classic ASP Databases 6 September 11th, 2004 05:14 AM
what is the benefits for each approach alyeng2000 SQL Server 2000 6 December 31st, 2003 05:48 AM



All times are GMT -4. The time now is 12:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc