I have a document library in which I need to define new Document Set and upload some files in that Document Set.
This is the example by which I tried it:
http://mstechsharing.blogspot.com/2012/03/article-3-create-new-document-sets-and.html
But, in this line, I always get null when I try to get folder by name:
SPFolder myLibraryToUploadDocument = spWeb.Folders[documentLibraryName].SubFolders[txtTitle.Text];
I tried the existing folder and existing Document Set, but it never returns that folder, always null.
I with hardcoded name this ("MyDocSet" is existing Document Set):
SPFolder myLibraryToUploadDocument = spWeb.Folders[documentLibraryName].SubFolders["MyDocSet"];
When I try this, it returns all folders as collection:
SPList myList = spWeb.Lists["MyDocLibrary"];
myList.Folders;
How can I get my folder or Document Set by name??