locked
Rss Link doesnt work i cant use any WebService or Xml link RRS feed

  • Question

  • User739596497 posted

    my code here

       private void button1_Click(object sender, EventArgs e)
            {
                XmlTextReader rdr = new XmlTextReader("Http://www.tcmb.gov.tr/kurlar/today.xml");
                XmlDocument xmlDoc = new XmlDocument();
                DataSet ds = new DataSet();
                ds.ReadXml(rdr);
                dataGridView1.DataSource = ds;
    
            }


    when i try to download something with   VS  always return to me null object i cant download any item xml or i cant use any WEBService !!

    Tuesday, March 5, 2013 12:31 AM

Answers

  • User1508394307 posted

    The above code works well for me but target XML includes two tables: Tarih_Date and currency. You might need to explicitly set the table, e.g.

    dataGridView1.DataSource = ds.Tables[1];

    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 5, 2013 4:04 PM

All replies

  • User-1662538993 posted

    Try something like this -

    HttpWebRequest rssFeed = (HttpWebRequest)WebRequest.Create("http://www.tcmb.gov.tr/kurlar/today.xml");
    
                using (DataSet rssData = new DataSet())
                {
                    //read the xml from the stream of the web request
                    rssData.ReadXml(rssFeed.GetResponse().GetResponseStream());
                }



    Tuesday, March 5, 2013 3:43 PM
  • User1508394307 posted

    The above code works well for me but target XML includes two tables: Tarih_Date and currency. You might need to explicitly set the table, e.g.

    dataGridView1.DataSource = ds.Tables[1];

    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 5, 2013 4:04 PM