Difference between appSettings and connectionStrings in Web.config file?

Why is there another section called connectionStrings? I always used appSettings until I noticed this in a new project:

<appSettings>
 <add key="SqlConnString" value="server=ABC;database=ABC;uid=A;pwd=B;"/>
</appSettings>

<connectionStrings>    
</connectionStrings>

Is there any difference? Any reason why I should use one over the other?

+5
source share
2 answers

In the documentation:

The connectionStrings element specifies the connection string database collection because the name / value of the pair for ASP.NET applications and features.

ASP.NET, AppSettings. ASP.NET 2.0 , , , , , Strings . connectionStrings .

, , ASP.NET 2.0 , connectionStrings.

+9

<connectionStrings>, , .

, , , , , app.config , .

+2

All Articles