I Finally Went And Did It

Thursday, March 22, 2007

Without the Internet, without people doing this (and without the Global Index, obviously) I don't think I could do my job as a developer. In fact, I couldn't do my job as a developer. With this in mind, I've setup this blog so that maybe I can give something back and ease my conscience at the same time.

Since I spend a great deal of time working on or thinking about the SharePoint project I'm currently involved with, it's likely I'll post about that most frequently, at least for the time being. I also want to post on related computing, developer topics too, so we'll see how things work out.

Targeting this post at my current readership, here are a couple of thoughts I might need to remind myself of in the future.

  1. I chose to start this. If at anytime it becomes too much work, too stressful or too boring I'm allowed to stop.
  2. The signal-to-noise ratio of the Internet is low enough already. I should avoid making things worse for everybody's sake.

I finally went and did it.

3 Comments | Musings

Comments

Sanjay Tiwari said... Hi,

I found your article very useful. I am doing something similar to that. My requirement is to have <add key="key" value="value"> added in the <appSettings> section of the web.config file. can you help in that. If you have any code for that will be great.

Thanks a lot.

Wednesday, April 18, 2007

Paul Horsfall said... Hi Sanjay

For the example you gave, the changes you'd need to make would look something this:

SPWebConfigModification myModification = new SPWebConfigModification("add[@key='key']", "configuration/appSettings");
myModification.Value = "<add key=\"key\" value=\"value\" />";
myModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;

I'd encourage you to have a look at the links in the original post as they have examples of making very similar changes, and the Web.config modification manager for SharePoint will help you to test this from the browser.

Friday, April 20, 2007

Sanjay Tiwari said... Paul, Thanks a lot for your help. Finally I wrote the following code and its working.

SPWebConfigModification modification = new SPWebConfigModification();
modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
modification.Path = "configuration/appSettings";
modification.Name = "mod";
modification.Value = "<add key='CVX.ITC.GIL3IM.RetentionDB.Connection' value='Data Source=gil3poc1.ctsqldb.chevrontexaco.net\\sql01;Initial Catalog=GIL3TestBDC;User ID=@userid;Password=@password' />";
modification.Sequence = 0;

app.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

Sanjay

Wednesday, May 02, 2007

Post a Comment

Title
 
Name (Required)
 
Email (Optional, and never displayed)
Website (Optional)
Comments
 
Please add 3 and 3 and type the answer here: