Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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="195.12.10.61" />

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 ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
Thank you very much, Russell, That did the trick!! –  Jithu Dec 26 '11 at 6:41

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:

http://msdn.microsoft.com/en-us/library/ff798488.aspx

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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