How do you write an XML file from an System.Xml.XmlReader?
I thought this would be a simple question but whenever I search I seem to be ending up with reading the file to a reader or writing node by node.
The XmlReader object conveys xml that was stored in a database and just needs to come out of the database to a file. Is there any easy way to do this?
SqlCommand dataCmd = new SqlCommand(sqlText, Conn);
System.Xml.XmlReader dataReader = null;
dataCmd.CommandTimeout = 60000;
Conn.Open();
dataReader = dataCmd.ExecuteXmlReader();
dataReader.Read();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…