c# - Why can't I update metadata on an SPFile object? -


according microsoft's documentation:

the windows sharepoint services 3.0 object model supports updating file metadata. can use indexer on property set value. example, set value of mydate property given file current date , time, use indexer , call update method, follows:

[visual basic]

ofile("mydate") = datetime.now

ofile.update()

[c#]

ofile["mydate"] = datetime.now;

ofile.update();

but when write line of code:

ofile["test"] = "test"; 

it errors out with:

cannot apply indexing [] expression of type 'microsoft.sharepoint.spfile'

am doing wrong or did microsoft screw up?

i don't have sharepoint try on right now, looks sample wrong. believe should ofile.properties["test"]="test"; article talks properties property.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -