Hi all,
A file was created with 100 versions. we tried to reduce it to 50 versions by deleting from 'view version history' option from UI. it got deleted but while taking the total version count using the below code snippet returns 100. am not aware of the functionality.
code:
using (SPSite site = new SPSite(ConfigurationManager.AppSettings.Get("siteurl")))
{
using (SPWeb web = site.OpenWeb())
{
SPListItem spListItem = web.GetListItem(ConfigurationManager.AppSettings.Get("ListItemURL"));
SPFile spFile = spListItem.File;
SPFileVersionCollection fileVersionColl = spFile.Versions;
int totalVersions = fileVersionColl.Count;
Console.WriteLine("Total version count is: " + totalVersions.ToString());
}}
Please suggest on this.
Thanks.