473,408 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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

Feb 7 '06 #1
4 1429
DWS
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

Feb 9 '06 #2
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 :)

Feb 12 '06 #3
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" <da**@palfery.com> wrote in message
news:11*********************@g43g2000cwa.googlegro 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

Feb 12 '06 #4
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.

Feb 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick | last post by:
hi, I have two asp.net project, and one is the main project, the other one is accessorial project, like a tool for the main project. I am planning to find a webhost provider and put the main...
3
by: Nuno | last post by:
At first, I was trying to encrypt ConnectionStrings in my app.config and still be able to modify my datasets. So, i had to modify the Settings.Designer.cs file to handle the decryption aspect in...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
0
by: planetmatt | last post by:
I am trying to copy a text file into a sql server database but I am having problems with an undeclared variable error. The variable in question is a reference to the connection string name in the...
2
by: Mike P | last post by:
I've always put my connection strings in the web.config, but I've just recently seen an example of a connection string in a resource file. What are the advantages of doing this, and could you do it...
9
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have a question about storing the connection strings to the database in a config file or database. My manager wants me to store all the connection strings in a database, but I...
2
by: VB Programmer | last post by:
Using ASP.NET 2.0 Created DataSet1.xsd. It's using the Connection "ASPNETDBConnectionString (Web.config)". I want to use a different one, LocalSqlServer. How do I change it? I tried to...
2
by: Simon | last post by:
I have problems with connection strings. I have added new connection string to Web.config: <connectionStrings> <add name="ConnStr" connectionString="xxxxxxxxxxxxxxx"/> </connectionStrings> ...
0
by: calvinkwoo3000 | last post by:
My Window application run property withour link to mdb without password. Once i set security password to mdb file, the error belor come out when i click detail. Not a valid password. and detail...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.