Kho kom raug InfoPath XML yog cov ntaub ntawv hauv cov tsev qiv ntawv muaj rooj sab laj nyob SharePoint Programmatically yuav ua li cas 2007

Cov lus hauv qab ntawm txoj kab snippet no yuav hloov tau cov ntaub ntawv infopath xml(cov ntaub ntawv)

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

MemoryStream myInStream = tshiab MemoryStream(yam khoom.File.OpenBinary());
XmlTextReader nyeem ntawv = tshiab XmlTextReader(myInStream);

XmlDocument doc = tshiab XmlDocument();
doc.Load(nyeem ntawv);

nyeem ntawv.Kaw();
myInStream.Close();

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

doc.DocumentElement.SelectSingleNode(“Kuv:Xwm txheej”, nameSpaceManager).InnerText = “Rua”;
doc.DocumentElement.SelectSingleNode(“Kuv:SaveDate”, nameSpaceManager).InnerText = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = System.Text.ASCIIEncoding tshiab();
SPFile newFile = _web.Folders[“SampleFormLib”].Files.Add(yam khoom.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), tseeb);
yam khoom.File.Update();

Xyuas kom koj txim tuag yam khoom.File.Update() yuav kuas nyuas siv zug muaj cov kev hloov (Kuv tau txais tus uas tsis thaum coj cov khoom.Hloov tshiab() and spent couple of hours to find 🙁 )

1 tawm tswv yim ua tau li cas rau txawv InfoPath XML nyob hauv rooj sab laj qiv Programmatically nyob SharePoint 2007

sau ntawv cia

Koj siv tau qhov cim npe no HTML

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