Hi,
We have a WSS3 Sharepoint server.
I want to move documents from one ducument library to another. I need to keep all the metadata of the file and all the versions, etc.
I found this article about this:
http://www.sharepointblogs.com/dez/archive/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history.aspxI try to build a web page using the sample code in there. I used Microsoft Visual Web Developer 2005 Express to try to buid that web page.
i added a reference to the sharepoint.dll and the defaul.aspx is fine but when i get an error inthe default.aspx.cs at the line 40:
" SPSite mySite = SPContext.Current.Site; " that says :
System.NullReferenceExcept
ion was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_ry9z9pmi"
StackTrace:
at _Default.GetSites() in c:\movedocs\Default.aspx.c
s:line 40
at _Default.Page_Load(Object sender, EventArgs e) in c:\movedocs\Default.aspx.c
s:line 32
at System.Web.Util.CalliHelpe
r.EventArg
FunctionCa
ller(IntPt
r fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEvent
HandlerDel
egateProxy
.Callback(
Object sender, EventArgs e)
at System.Web.UI.Control.OnLo
ad(EventAr
gs e)
at System.Web.UI.Control.Load
Recursive(
)
at System.Web.UI.Page.Process
RequestMai
n(Boolean includeStagesBeforeAsyncPo
int, Boolean includeStagesAfterAsyncPoi
nt)
I have never programmed anything in my life but i think here is just a little thing that i am missing.
Thanks
Start Free Trial