
Dim
targetWeb As SPWeb = SPControl.GetContextWeb(Context).Webs.Item("sites/IT")
Dim docLib As SPDocumentLibrary = CType(targetWeb.Lists.Item(New Guid(targetFolderGUID)), SPDocumentLibrary)
Dim docLibFile As SPFile = docLib.RootFolder.Files.Add(fileName, fileContents)
Dim docItem As SPListItem = docLibFile.Item
docItem.Fields("Category") = "General"
If I attempt to set the value of a field (i.e. a Column) in a List, the complier complains that:
Property 'Item' is 'ReadOnly'
Anyone know why I shouldnt be allowed to do it this way?!
UPDATE: the following code is what I was looking for...
docItem("Category") = "General"
docItem.Update()