Jinsi ya Hariri InfoPath XML File katika Library Forum Programmatically katika SharePoint 2007

chini ya mistari ya Snippet code ni update xml infopath rekodi(file)

SPWeb _web = SPContext.Current.Web;
SPList _list = _web.Lists[“SampleFormLib”];

MemoryStream myInStream = MemoryStream mpya(item.File.OpenBinary());
XmlTextReader msomaji = XmlTextReader mpya(myInStream);

XmlDocument doc = mpya XmlDocument();
doc.Load(msomaji);

reader.Close();
myInStream.Close();

XmlNamespaceManager nameSpaceManager = XmlNamespaceManager mpya(doc.NameTable);
nameSpaceManager.AddNamespace(“yangu”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);

doc.DocumentElement.SelectSingleNode(“yangu:Hali ya”, nameSpaceManager).Ndani Nakala = “Kuokolewa”;
doc.DocumentElement.SelectSingleNode(“yangu:SaveDate”, nameSpaceManager).InnerText = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = System.Text.ASCIIEncoding mpya();
SPFile newFile = _web.Folders[“SampleFormLib”].Files.Add(item.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), kweli);
item.File.Update();

Kuhakikisha nitafanya item.File.Update() kufanya mabadiliko (I got makosa wakati nitafanya item.Update() and spent couple of hours to find 🙁 )

1 maoni ya Jinsi ya Hariri InfoPath XML File katika Library Forum Programmatically katika SharePoint 2007

BBC

Unaweza kutumia haya HTML

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>