Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Can't see Connection Strings in wwwroot web.config

 
Thread Tools Search this Thread
Old 02-07-2006, 11:21 PM   #1
Default Can't see Connection Strings in wwwroot web.config


We store all of our connection strings in the root web.config. I have a
connection string called connectionString1 stored in the web.config
file at wwwroot. I can get to this through code no problem. My problem
is when I use the Grid View control and configure the datasource. The
wizard asks for a datasource type I select sqlserver. Then it asks for
a connection string, I click on the drop down. No connection string. If
I move my connection string into the local web.config it shows up. What
am I missing? Any suggestions welcome Thanks



Dave
  Reply With Quote
Old 02-09-2006, 02:18 PM   #2
=?Utf-8?B?RFdT?=
 
Posts: n/a
Default RE: Can't see Connection Strings in wwwroot web.config
Dave,
Your missing the modern enterprise environment does not allow every web_app
access to the same connections.

Good Luck
DWS


"Dave" wrote:

> We store all of our connection strings in the root web.config. I have a
> connection string called connectionString1 stored in the web.config
> file at wwwroot. I can get to this through code no problem. My problem
> is when I use the Grid View control and configure the datasource. The
> wizard asks for a datasource type I select sqlserver. Then it asks for
> a connection string, I click on the drop down. No connection string. If
> I move my connection string into the local web.config it shows up. What
> am I missing? Any suggestions welcome Thanks
>
>



=?Utf-8?B?RFdT?=
  Reply With Quote
Old 02-12-2006, 08:48 PM   #3
Dave
 
Posts: n/a
Default Re: Can't see Connection Strings in wwwroot web.config
Are you saying that the best practices of 1.1 are now not supported in
2.0? We create a different connection string for every app but we store
them all in the root web.config. This is very beneficial, because it
allows us to secure the web.config to just a few people while allowing
many developers to write apps. It is also good for our migration path.
I can develop an app on my local machine using a test database, then
when the app is ready to move to production I can simply move the
source code to the production web server and the connection to the
database is changed to the production database. If the modern
enterprise environment does not support this then I think perhaps we
should re thing the new stuff



Dave
  Reply With Quote
Old 02-12-2006, 08:57 PM   #4
Juan T. Llibre
 
Posts: n/a
Default Re: Can't see Connection Strings in wwwroot web.config
re:
> I move my connection string into the local web.config it shows up.
> What am I missing? Any suggestions welcome Thanks


What you're missing is that VS reads web.configs on a per-application basis.

As long as your connection string is within the same app, VS will see it fine.
If you're in a different app, though, VS won't see it.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Dave" <> wrote in message
news: ups.com...
> We store all of our connection strings in the root web.config. I have a
> connection string called connectionString1 stored in the web.config
> file at wwwroot. I can get to this through code no problem. My problem
> is when I use the Grid View control and configure the datasource. The
> wizard asks for a datasource type I select sqlserver. Then it asks for
> a connection string, I click on the drop down. No connection string. If
> I move my connection string into the local web.config it shows up. What
> am I missing? Any suggestions welcome Thanks
>





Juan T. Llibre
  Reply With Quote
Old 02-17-2006, 03:02 AM   #5
Dave
 
Posts: n/a
Default Re: Can't see Connection Strings in wwwroot web.config
Juan,
Thanks for answering but I think you misunderstood me. When I say the
root Web.config I meet the root of the website. In 1.1 I was able to
use the website config to hold the connection strings in appsetting in
the web.config file at the root of the website. Then I would create a
sub folder for each application and configure it, but I was still able
to appsettings from the config file at the higher level. this is not
possible with connection string. The other problem I have run into is
that if I add a connectionStrings tag to me root config file all my 1.1
programs stop working because they do not recognize the tag. Is it now
considered best practice to store my connection strings in the
web.config of each application instead of at the root or machine level.
I find this strange since I first learned about this method at a MSDN
event for Widby.



Dave
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure VPN hi5 Hardware 1 07-09-2007 12:21 PM
Sharing wireless Internet connection with wired connected desktop... josh321 General Help Related Topics 0 11-14-2006 07:59 PM
Spurious Internet Connection ch742718 Hardware 5 07-19-2006 07:12 AM
Laptop wireless connection johnnygeargrinder2004@yahoo.com A+ Certification 7 03-09-2005 03:05 AM
connect a source unit with an S-Video connection to a receiving unit that has an RCA composite video connection ? worth it ? OCZ Guy DVD Video 6 08-01-2004 06:44 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46