views:

997

answers:

2

This is my connection string inside my web.config of my SharePoint site. Its sitting just below the closing SharePoint tag.

<connectionStrings>
    <add name="SAMRASConnectionString" connectionString="Data Source=JOHANDEVVM;
        Initial Catalog=samrasDB; User ID=Johan; Password=password; Trusted_Connection=True"
        providerName="System.Data.SqlClient"  />
</connectionStrings>

Where must i place it in order to get a Global Connectionstring.

Reason be: When i go to my IIS site Properties -> ASP.NET tab -> Edit Global Configuration Then the connection string is not there, its only by the Edit Configuration.

I need it to be there to access it from other client computers. I need to change it in my web.config file and dont want to go add it manually on the Server.

A: 

You can use an SPWebConfigModification in a feature reciever to add web.config modifications to all servers in a farm.

http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32

JMD
+1  A: 

Add the connectionString in Machine.Config if you have access to it.

Gthompson83