locked
An error occurred while parsing EntityName. RRS feed

  • Question

  • User-2102953448 posted

    An error occurred while parsing EntityName error.

           XmlDocument ReadInDocument = new XmlDocument();
                ReadInDocument.XmlResolver = null;
                ReadInDocument.Load("http://abone.iha.com.tr/yeniabone/RSS2.aspx?Kategori=3");
    
    
    
    
                foreach (XmlNode node in ReadInDocument.SelectNodes(".//rss/channel/item"))
                {
    
    
                    SqlCommand komut1 = new SqlCommand("Select*from gelenhaberler where HaberKodu=@HaberKodu", strConnString);
                    komut1.Parameters.AddWithValue("@HaberKodu", node.SelectSingleNode("HaberKodu").InnerText);
                    SqlDataReader oku = komut1.ExecuteReader();
                    if (oku.HasRows)
                    {
    
                    }
                    else
                    {
                        SqlCommand cmd = new SqlCommand(strQuery);
                        cmd.CommandType = CommandType.Text;
                        cmd.Connection = strConnString;
                        cmd.Parameters.AddWithValue("@HaberKodu", node.SelectSingleNode("HaberKodu").InnerText);
                        cmd.Parameters.AddWithValue("@Sehir", node.SelectSingleNode("Sehir").InnerText);
                        cmd.Parameters.AddWithValue("@title", Capitalize(node.SelectSingleNode("title").InnerText));
                        cmd.Parameters.AddWithValue("@description", node.SelectSingleNode("description").InnerText);
                        cmd.Parameters.AddWithValue("@pubDate", Convert.ToDateTime(node.SelectSingleNode("pubDate").InnerText));
                        cmd.Parameters.AddWithValue("@link", node.SelectSingleNode("link").InnerText);
                        cmd.ExecuteNonQuery();
                        cmd.Dispose();
                    }
                    komut1.Dispose();
                    oku.Close();
                }

     

    Saturday, February 21, 2015 6:08 AM

All replies

  • User61956409 posted

    Hi fabregas42,

    Thanks for your post.

    An error occurred while parsing EntityName error.

    I recommend to debug your code to find which code causes the error. And you could show us the error message, it will help us to understand your problem.

    Best Regards,

    Fei Han

    Sunday, February 22, 2015 9:05 PM