![]() |
|
|
|||||||
![]() |
ASP Net - Can't see Connection Strings in wwwroot web.config |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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?= |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |