Tags

I have an interesting problem when trying to update an InfoPath Form Data. If I use XMLDOCUMNET and node to update the xml file. I got problem to load the data. So I have to use

StreamReader sr = new StreamReader(filename);
String file = sr.ReadToEnd();
sr.Close();
file = file.Replace(oldtext, newtext);
StreamWriter sw = new StreamWriter(filename);
sw.Write(file);
// Close StreamWriter
sw.Close();

Advertisements