Umbraco - Try to read document properties programatically but always getting null
I am writing a console application to read content from my umbraco database. I am unable to get following simple code to work. This code is using Umbraco 4.x
var doc = new Document(1081);
Console.WriteLine("Package Id: {0}", doc.getProperty("packageId").Value);
There is a document in Umbraco and I have created content against that document. The content node is published and has id of 1081. The first line works fine and returns me the correct content node but second line fails to retrieve the property named packageId. There is a property with this name on the document type and I can see this value in the xml of the content node in cmsContentXml table in Umbraco database.
Is running this inside a console application a problem? I do not seem me to think so otherwise the first line of code would not have worked either.
Umbraco - Try to read document properties programatically but always getting null
I am writing a console application to read content from my umbraco database. I am unable to get following simple code to work. This code is using Umbraco 4.x
There is a document in Umbraco and I have created content against that document. The content node is published and has id of 1081. The first line works fine and returns me the correct content node but second line fails to retrieve the property named
packageId
. There is a property with this name on the document type and I can see this value in the xml of the content node incmsContentXml
table in Umbraco database.Is running this inside a console application a problem? I do not seem me to think so otherwise the first line of code would not have worked either.
is working on a reply...