ಕೋಡ್ ತುಣುಕನ್ನು ಕೆಳಗೆ ಸಾಲುಗಳನ್ನು InfoPath ಮದುವೆ ದಾಖಲೆ ನವೀಕರಿಸಲು ಆಗಿದೆ(ಫೈಲ್)
SPList _list = _web.Lists[“SampleFormLib”];
MemoryStream myInStream = ಹೊಸ MemoryStream(item.File.OpenBinary());
XmlTextReader ರೀಡರ್ = ಹೊಸ XmlTextReader(myInStream);
XmlDocument ಡಾಕ್ = ಹೊಸ XmlDocument();
doc.Load(ರೀಡರ್);
reader.Close();
myInStream.Close();
XmlNamespaceManager nameSpaceManager = ಹೊಸ XmlNamespaceManager(doc.NameTable);
nameSpaceManager.AddNamespace(“ನನ್ನ”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);
doc.DocumentElement.SelectSingleNode(“ನನ್ನ:ಸ್ಥಿತಿ”, nameSpaceManager).ಒಳ ಪಠ್ಯ = “ಉಳಿಸಿದ”;
doc.DocumentElement.SelectSingleNode(“ನನ್ನ:SaveDate”, nameSpaceManager).InnerText = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
SPFile newFile = _web.Folders[“SampleFormLib”].Files.Add(item.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), ನಿಜವಾದ);
item.File.Update();
Make sure you execute item.File.Update() to commit the changes (I got the errors while execute item.Update() and spent couple of hours to find 🙁 )
Have you considered adding some differing opinions to your article? I think it might enhance viewers understanding.