Linjat e mëposhtme kodin e copë është për të rinovuar të dhënat xml InfoPath(skedar)
SPList _list = _web.Lists[“SampleFormLib”];
MemoryStream myInStream = MemoryStream i ri(item.File.OpenBinary());
Lexues XmlTextReader = XmlTextReader i ri(myInStream);
XmlDocument doc = ri XmlDocument();
doc.Load(lexues);
reader.Close();
myInStream.Close();
XmlNamespaceManager nameSpaceManager = XmlNamespaceManager i ri(doc.NameTable);
nameSpaceManager.AddNamespace(“tim”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);
doc.DocumentElement.SelectSingleNode(“tim:Gjendje”, nameSpaceManager).Inner Text = “Saved”;
doc.DocumentElement.SelectSingleNode(“tim: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)), i vërtetë);
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.