Hi all
I am trying to retrieve the properties of the Files (Name, Created By and Last Modified By) from document library before migrating the documents from SP2003 to MOSS 2007
but the system hangs at the line temFile.Author.Email
here is what i am doing
don't know why this doesn't work.
I have done a bit of a research into it and come to a conclusion that, the system is hanging because we have around 100000 documents in that library.
but why SP2003 is trying to load the entire document library, when we asked for it to get the file properties by giving the absolute URL of the filen directly.
any help will be really really apreciated, as i was struggling to find another alternative to fix this problem.
Many Thanks
I am trying to retrieve the properties of the Files (Name, Created By and Last Modified By) from document library before migrating the documents from SP2003 to MOSS 2007
but the system hangs at the line temFile.Author.Email
here is what i am doing
Code:
SPSite site = new SPSite(sharePointURL);
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates=true;
string strContentType="";
// docLib is the name of document library
SPFolder folder = web.GetFolder("docLib");
SPFileCollection files=folder.Files;
//"docLib" is name of document library and testFile.doc is the name of file
string url=sharePointURL+"/"+"docLib"+"/"+"testFile.doc"
SPFile tempFile = web.GetFile(url);
[COLOR=#ff0000]tempFile.Name (//THis works perfect)
temFile.Author.Email( //System Hangs)
temFile.ModifiedBy.Email (System Hangs)[/color]
don't know why this doesn't work.
I have done a bit of a research into it and come to a conclusion that, the system is hanging because we have around 100000 documents in that library.
but why SP2003 is trying to load the entire document library, when we asked for it to get the file properties by giving the absolute URL of the filen directly.
any help will be really really apreciated, as i was struggling to find another alternative to fix this problem.
Many Thanks