form is a very important feature of Moss, especially with the support of form services, we often use InfoPath when we do a form solution, so how do we use code to access the contents of an InfoPath form saved in a SharePoint form library? is necessary to know.
In summary, there are 3 ways to achieve code access to the form's content:
1. Promote form template properties
2. Action on a form file by XmlDocument object
3. Deserialization of form data schemas
Next, simply talk about the simple implementation steps of these 3 methods
The first way: to promote the form template property form action:
When you finish designing your form template, when you execute the Publish Wizard, you publish the form fields that you want to access through code, and the check allows users to edit
Access code:
The first is to get the current list item, SPListItem Item=infopath item, such as
SPListItem item= workflowproperties.
Item;item ["workflowstatus"] = value;
Item. Update ();
This approach is simple, but it's not safe to allow users to edit. For some sensitive data, this method is not recommended.