Tutorial by Examples

To fetch the latest version of an item in the current language: Sitecore.Context.Database.GetItem(new ID("{11111111-1111-1111-1111-111111111111}"));
If you need to get a specific language or version of an item, you can use these overloads of GetItem() Sitecore.Context.Database.GetItem("/sitecore/content/Sitecore", Language.Current, new Version(5));
To fetch the latest version of an item in the current language: Sitecore.Context.Database.GetItem("/sitecore/content/Sitecore")
To get the raw value of a field on the Context Item: Sitecore.Context.Item["Field Name"]; To get the raw value of a field on a given item, item: item["Field Name"];
When publishing Sitecore item programmatically the developer should keep in mind that Sitecore could be configured for several publishing targets, as well that several languages could be defined for item. ID targetDatabaseFieldId = ID.Parse("{39ECFD90-55D2-49D8-B513-99D15573DE41}"); ...

Page 1 of 1