|
|
 |
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.
|
 |

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
|
|
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
|

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
|
|
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!)
|

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
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |