问题
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.
回答1:
Add the connectionString in Machine.Config if you have access to it.
回答2:
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
来源:https://stackoverflow.com/questions/649871/how-to-create-a-global-connectionstring-to-sql-server-database-for-my-sharepoint