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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error with appsettings 1

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
0
0
US
I am getting an error in the addkey line in my web.config file. The addkey is the connection to an Access database.

<appSettings>

<add key = &quot;ConnectionString&quot; value = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Website\trainingnew\Clarification.mdb&quot; />

</appSettings>

I am pretty new to .Net
Any help appreciated.

 
Hi AgentM!

I just tested you code in my own web.config and there were no errors. Could you post some more of your web.config file?

Best Regards
Kenni
 
Sure here it is :-
It's a std file created by VS.Net.


<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<configuration>
<system.web>

<compilation defaultLanguage=&quot;vb&quot; debug=&quot;true&quot; />
<customErrors mode=&quot;RemoteOnly&quot; />
<authentication mode=&quot;Windows&quot; />
<authorization><allow users=&quot;*&quot; /> <authorization>
<sessionState mode=&quot;InProc&quot;
stateConnectionString=&quot;tcpip=127.0.0.1:42424&quot;
sqlConnectionString=&quot;data source=127.0.0.1;Trusted_Connection=yes&quot;
cookieless=&quot;false&quot;
timeout=&quot;20&quot;
/>

<globalization requestEncoding=&quot;utf-8&quot; encoding=&quot;utf-8&quot; />


<appSettings>

<add key = &quot;ConnectionString&quot; value = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Website\trainingnew\Clarification.mdb&quot; />

</appSettings>

</system.web>

</configuration>


Thank you
 
Okay I have something for you!

1. <appSettings> should be placed outside of <system.web> - not inside as you have it now.

2. <authorization><allow users=&quot;*&quot; /> <authorization> you forgot an &quot;/&quot; in your closing tag </authorization>.

3. <globalization requestEncoding=&quot;utf-8&quot; encoding=&quot;utf-8&quot; /> Not too sure about this line. However I couldn't find any attribute by the name &quot;encoding&quot;. Maybe this should be called &quot;responseEncoding&quot; - it works for me.

Are you using this last line for anything - else you can just delete it and it will use you defaults.

Okay that should do it, hope it works!
Best Regards
Kenni


 
thank you Kenni.

Moved <appsettings> outside fo <system.web> and it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top