my blog RSS 2.0
 Friday, May 28, 2004

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()

Friday, May 28, 2004 8:01:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [5] -
SharePoint
Archive
<May 2004>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Rohan Cragg
Sign In
Statistics
Total Posts: 24
This Year: 0
This Month: 0
This Week: 0
Comments: 42
Themes
Pick a theme:
All Content © 2008, Rohan Cragg
DasBlog theme 'Business' created by Christoph De Baene (delarou)