L-hawn taħt linji ta 'snippet kodiċi huwa li taġġorna r-rekord xml InfoPath(fajl)
SPList _list = _web.Lists[“SampleFormLib”];
MemoryStream myInStream = MemoryStream ġdida(item.File.OpenBinary());
Qarrej XmlTextReader = XmlTextReader ġdida(myInStream);
Doc XmlDocument = XmlDocument ġdida();
doc.Load(qarrej);
reader.Close();
myInStream.Close();
XmlNamespaceManager nameSpaceManager = XmlNamespaceManager ġdida(doc.NameTable);
nameSpaceManager.AddNamespace(“tiegħi”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);
doc.DocumentElement.SelectSingleNode(“tiegħi:Status”, nameSpaceManager).Test Inner = “Ssejvjata”;
doc.DocumentElement.SelectSingleNode(“tiegħi: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)), veru);
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.