Try WebClient instead, much easier to use:
private static String[,] Rss_read(string connection)
{
string[,] feedData = new string[40, 3];
WebClient client = new WebClient();
XmlDocument rssxmlDoc = new XmlDocument();
string downloadString = client.DownloadString(connection);
rssxmlDoc.LoadXml(downloadString); ///statement which return exception;
XmlNodeList rssItme = rssxmlDoc.SelectNodes("rss/ chanel/item");
for (int i = 0; i < rssItme.Count; i++)
{
// Your logic here
}
return feedData;
}
As to WHY you're getting a 500 error, my guess is that the XmlDocument.Load() method you are using does not have the full capabilities of a web client, so it cannot handle cookies and 301/302 redirections from the target URL very well. See below: