If somebody like the post and its helpful in your work then, add comments.

Tuesday, November 3, 2009

Get values from InfoPath form XML in Form Library

To get values from the InfoPath xml , their are two values

1. By promoting the values of InfoPath form to form library and get that values by using SPObject and SPListItemObject.

2. Is that is below :

SPWeb _web = SPContext.Current.Web;

string temXml = _web.GetFileAsString("Idea Forms/Formulate.xml");
            XmlDocument xDoc = new XmlDocument();
            XmlNamespaceManager ns = new XmlNamespaceManager(xDoc.NameTable);
            ns.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-02-08T09:24:40");


string strSampleValue = xDoc.SelectSingleNode("//my:myfield", ns).InnerText;