Just publish the form programmatically and everything in the form will
automatically be submitted. You may use the following code to submit:
public void FormEvents_Submit(object sender, SubmitEventArgs e)
{
FileSubmitConnection fc =
(FileSubmitConnection)this.DataConnections["Main submit"];
// Modify the URL we want to submit to by concatenating the
string dLocation = this.Location.ToString();
fc.FolderUrl = dLocation.Substring(0, dLocation.LastIndexOf("/"));
// Execute the submit connection
try
{
fc.Execute();
e.CancelableArgs.Cancel = false;
}
catch (Exception ex)
{
e.CancelableArgs.Cancel = true;
}
Location is a local variable. You can skip it and use the following line
instead:
string dLocation = "http://server/dolib/forms/AllItems.aspx"; --> This is
just a sample, use the exact complete library URL here and you can also
capture the url programmatically. For example,
dLocation = this.Template.Uri.ToString();
Hope this helps
SSA
MOSS MVP
> Hi,
> Is it possible to publish an InfoPath's data programmatically?
[quoted text clipped - 6 lines]
> Thanks in advance
> Sadhana
sadhana - 15 Aug 2007 16:26 GMT
Hi,
What is this "Main Submit" in Data Connections?
Is it a dataconnection library in sharepoint server or just a dataconnection
to submit data? even, I tried it in both cases, it is not working.
and what is this "Location" in the program. I have given the URL directly at
the dlocation.
How to proceed after this?
Thanks
> Just publish the form programmatically and everything in the form will
> automatically be submitted. You may use the following code to submit:
[quoted text clipped - 48 lines]
> > Thanks in advance
> > Sadhana