I have this SPListItem.Folder in sharepoint that contains a property named "Asset ID".
I have this data in my list
Asset ID | Name | Asset Type
1 | GamesFolder | Games
2 | AppsFolder | softwares
3 | MusicFolder | music
In my code I did this
SPList objList = web.Lists["MyList"];
SPQuery query = new SPQuery();
query.Query = "<OrderBy><FieldRef Name='Asset ID' Ascending='FALSE'/></OrderBy>";
query.ViewAttributes = "Scope=\"Recursive\"";
query.RowLimit = 1;
SPListItemCollection items = objList.GetItems(query);
return objList.Items[0].Folder.Properties["Asset ID"].ToString();
I use .Folder because every entry in the list is a DocumentSet. The returned value is always "1". I don't know what's wrong why my sorting doesn't work at all.
Please help me resolve this issue. Thanks.