Add a secondary xml(let it be ViewOptions.Xml) to your Infopath form. In the ViewOptions.Xml add a SharePointUrl Node in that node place your sharepoint URL to that node.
for example the viewOptions.XML is:
<ViewOptions>
<sharePointFolderUrl>Local Config</sharePointFolderUrl>
</ViewOptions>
Now get the viewoptions.XMl dom (let the viewoptions.XMl dom be domViewOptions) into your code for getting the SharePoint URL.Use the below code for submitting your infopath form to the sharepoint.
public bool SubmitDataToSharePoint()
{
string sharePointFolderPath = GetNodeValue(domViewOptions, "/ViewOptions/sharePointFolderUrl");
try
{
DAVAdapter sharePoint = (DAVAdapter)thisXDocument.DataAdapters[submitAdapterName];
sharePoint.FileName = fileName;
sharePoint.FolderURL = sharePointFolderPath;
sharePoint.SubmitData(dataNode);
}
catch(Exception ex)
{
string sMessage = FAILED_UNKNOWN;
if(-1 != ex.Message.IndexOf("DAVAdapter"))
sMessage = FAILED_SUBMIT_SHAREPOINT;
else if(-1 != ex.Message.IndexOf("validation errors"))
sMessage = FAILED_SUBMIT_VALIDATION;
Alert(sMessage);
return false;
}
return true;
}
Like this you can place all your URL's in the ViewOptions.XML and can use that URl's into your code ,instead of changing the Manifest.xsn everytime.