I
Ira Grollman
While debugging why a web.config section replacement was not happening in the
real web application, I tried a simplified case, no replacement is enabled
and the connection string is not showing up?
Suggestions about what could be happening? The code:
Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
For Each objConnectionString As
System.Configuration.ConnectionStringSettings In _
rootWebConfig.ConnectionStrings.ConnectionStrings
lstCS.Items.Add(objConnectionString.Name & "|" &
objConnectionString.ConnectionString)
Next
Puts "LocalSqlServer|data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
" into the listbox.
The web.config is:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="test" connectionString="placeholder"/>
</connectionStrings>
<system.web>
<compilation defaultLanguage="vb" debug="true"/>
</system.web>
</configuration>
Thanks, Ira
Also posted in ASP.NET forum without response
real web application, I tried a simplified case, no replacement is enabled
and the connection string is not showing up?
Suggestions about what could be happening? The code:
Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
For Each objConnectionString As
System.Configuration.ConnectionStringSettings In _
rootWebConfig.ConnectionStrings.ConnectionStrings
lstCS.Items.Add(objConnectionString.Name & "|" &
objConnectionString.ConnectionString)
Next
Puts "LocalSqlServer|data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
" into the listbox.
The web.config is:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="test" connectionString="placeholder"/>
</connectionStrings>
<system.web>
<compilation defaultLanguage="vb" debug="true"/>
</system.web>
</configuration>
Thanks, Ira
Also posted in ASP.NET forum without response