i am now at work on the MOSS but when i use this code:
//conection with this adress as the form library "http://Sharepoint/sites/pilot/Urendeclaratie"
FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["Submit"];
fc.FolderUrl = SPContext.Current.Web.Url.ToString() + "/verwerken"; //a submap in the library
fc.Execute();
now i want to put the form into differens maps in that library.
but i get this error
System.NullReferenceException
Object reference not set to an instance of an object.
at declaratie_met_code4.FormCode.FormEvents_Submit(Object sender, SubmitEventArgs e)
at Microsoft.Office.InfoPath.Internal.FormEventsHost.OnSubmit(DocReturnEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnSubmitRequest(DocReturnEvent pEvent)
this even occurs when i use this setup:
http://Sharepoint/sites/pilot as the DataConnection Adress
/Urendeclaratie as the fc.FolderUrl extra
i tried putting the http://Sharepoint/sites/pilot/Urendeclaratie/verwerken directly in the DataConnection and then i am asked for a Login.
and my own credentials does not work.
so i searched the web for a way to submit anonymously and found this site (http://blog.metrostarsystems.com/2009/06/04/anonymously-submit-infopath-form-to-sharepoint-library/) but this also doesn't work (cant set the anonymous login)
but becauce i dont want to submit it anonymous i have to find another way to solve this.
any suggestions??