Reading XML data into DataTable (c#)
System.Net.HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create("URL");
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml";
webRequest.AllowAutoRedirect = true;
System.Net.HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream s = webResponse.GetResponseStream();
StreamReader r = new StreamReader(s);
string xml = r.ReadToEnd();
Response.Write(xml);
s.Close();
r.Close();
webResponse.Close();
Categories: Genel