HI I am trying to deploy a web site from my friend in SharePoint 2010. How ever I am not sure under which node / child in web . config file I have to insert the below code? Could any one please help me with it?

<!--ABC Entries Start-->
    <add key="SiteUrl" value="http://sok:6000" />
    <add key="ABCConnectionString" value="User Id=sa; Password=123; Integrated Security =true; Data Source=(local); Initial Catalog = ABC; " />
    <add key="EmailID" value="1" />
    <add key="EmailName" value="" />

Also I am not sure instead of sa SQL account, can I use Windows authentication? If yes wat all chnages I need to make in the above connection string ?


These look like custom application settings. You should add them to the appSettings element, or create it inside the configuration element if it is not.

You have to give permissions for an account in SQL server to use. Sharepoint can be configured to run under specific service accounts ( it is recommended) so give permission for the account to SQL and set the connection string.


SharePoint is no different than ASP.NET as far as web.config entries are concerned. SharePoint's web.config content are different from a typical ASP.NET application though. So if your application depends on those settings, they would go into appSettings section of the web.config, just like ASP.NET applications.

For storing custom application settings, I prefer to store them in SharePoint's content database though and I prefer to fascilitate custom application settings using Application Settings Manager that comes with Microsoft's Patterns and Practices for SharePoint. It's a reusable application framework for SharePoint. Check below:


  • Hi Ashish, the link was really helpful Thank you for spending your time on this and your detailed explanation!!
    – Jithu
    Dec 26 '11 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.