Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parser Error Unrecognized Element

Status
Not open for further replies.

Davidmc555

Programmer
Feb 7, 2005
39
GB
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.
 
Oh my god, I'm such a moron.

XML is case sensitive so "<Add Key=" should be "<add key=".

*kicks self*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top