解析EntityName错误时发生错误。
我发现了很多信息,但它没有任何帮助。
我需要详细的帮助
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();
}