Davidmc555
Programmer
This is probably quite simple and I should know this but I've look everywhere and can't seem to work this.
I have an ASP.NET app that is connected to a Access DB (don't ask) which is stored in the same place as the .ASPX and web.config files. (Again, don't ask.)
When I run the startup page, it runs fine but when it goes to connect to the DB using the VB code...
conLogonObj.ConnectionString = ConfigurationSettings.AppSettings("OleDBConnection")
I know this cos I stepped through the code to this point. I then get a generated Error page entitled ...
"Server Error in '/myapp' Application.
Configuration Error"
with "Parser Error Message: Unrecogized Element".
It highlights the code in the web.config...
Line 2: <configuration>
Line 3: <appSettings>
Line 4: <Add Key="OleDBConnection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\ Id=admin;Password=;"/>
Line 5: </appSettings>
Line 6: <system.web>
and points out line 4 to be the main offender. For the record, I've tried this on both the main web server and on my local copy and the error occurs on both.
When the connection string was hardcoded before there wasn't a problem but it had to be taken out for deployment reasons. Anyone know where I'm going wrong?
Thanks in advance.
I have an ASP.NET app that is connected to a Access DB (don't ask) which is stored in the same place as the .ASPX and web.config files. (Again, don't ask.)
When I run the startup page, it runs fine but when it goes to connect to the DB using the VB code...
conLogonObj.ConnectionString = ConfigurationSettings.AppSettings("OleDBConnection")
I know this cos I stepped through the code to this point. I then get a generated Error page entitled ...
"Server Error in '/myapp' Application.
Configuration Error"
with "Parser Error Message: Unrecogized Element".
It highlights the code in the web.config...
Line 2: <configuration>
Line 3: <appSettings>
Line 4: <Add Key="OleDBConnection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\ Id=admin;Password=;"/>
Line 5: </appSettings>
Line 6: <system.web>
and points out line 4 to be the main offender. For the record, I've tried this on both the main web server and on my local copy and the error occurs on both.
When the connection string was hardcoded before there wasn't a problem but it had to be taken out for deployment reasons. Anyone know where I'm going wrong?
Thanks in advance.