Last post Oct 15, 2011 10:03 PM by Decker Dong - MSFT
Oct 14, 2011 08:30 AM|Rajnish Kaur|LINK
I am creating a new httprequest and passing xml document with it using stream writer.
Now I want to read this XML file at the other end.
Page.Response.ContentType = "text/xml";
//Read XML posted via HTTP
StreamReader sreader = new StreamReader(Page.Request.InputStream);
String xmlData = sreader.ReadToEnd();
Here in xmlData am getting xml file comeing in String format and I need to read this entire XML file node wise and
have to save those values into the DB.
How to retreive node values from xmlData string.?
Oct 14, 2011 08:42 AM|chandrashekar|LINK
You can read the xml in to XMLDocument class as follows:
XmlDocument doc = new XmlDocument();
XmlNodeList list = doc.GetElementsByTagName("nodeName");
foreach (XmlNode node in list)
//Here process the node data.
Oct 15, 2011 10:03 PM|Decker Dong - MSFT|LINK
Hello Rajnish Kaur:)
If your xml's formation isn't so regular and it cannot be converted into DataTable or DataSet, you have to use XmlDoucment or XDocument to read the specific tags of the xml contents and assign to db with the help of SqlCommand+SqlConnection/