Sorry that was python rhinoscript syntax, i guess you`ll need:
Rhino.RhinoDoc.Strings.SetString(section, entry, value)
c.