<Aciklamalar>
<Aciklama HaberKodu="20141101AW232013" ResimKodu="20141101AW232013_01">
<![CDATA[
YENİ MALATYASPOR MAÇINDA SAKATLANAN UMAR, KARŞIYAKA DEPLASMANINA GÖTÜRÜLMÜYOR.
]]>
</Aciklama>
<Aciklama HaberKodu="20141101AW232013" ResimKodu="20141101AW232013_02">
<![CDATA[
YENİ MALATYASPOR MAÇINDA SAKATLANAN UMAR, KARŞIYAKA DEPLASMANINA GÖTÜRÜLMÜYOR.
]]>
</Aciklama>
</Aciklamalar>

Select HaberKodu text?

Select <!CDATA text?

Help.Thanks

Edited 2 Years Ago by Dani: Formatting fixed

string strQuery5 = "insert into gelenhaberaciklama(HaberKodu,Aciklama) values (@HaberKodu5,@Aciklama5)"; 
    SqlConnection con5 = new SqlConnection(strConnString5);
    con5.Open();
    XmlDocument ReadInDocument5 = new XmlDocument();
    ReadInDocument5.Load("XML FİLE");

    String HaberKodu5 = "";
    String Aciklama = ""; 

    foreach (XmlNode node5 in ReadInDocument5.SelectNodes(".//Aciklamalar/Aciklamala"))
    { 
        HaberKodu5 = node5.Attributes["HaberKodu"].InnerText;
        Aciklama5 = node5.ChildNodes[0].InnerText;

        SqlCommand cmd5 = new SqlCommand(strQuery5); 
        cmd5.CommandType = CommandType.Text;
        cmd5.Connection = con5;
        cmd5.Parameters.AddWithValue("@HaberKodu5", HaberKodu5.ToString());
        cmd5.Parameters.AddWithValue("@Aciklama5", Aciklama5.ToString());
        cmd5.ExecuteNonQuery(); 
    }
    con5.Close();
    con5.Dispose();

HaberKodu5 and Aciklama5 insert to null sql. Parametrs null value. Help?

Here you diclare a string variable "Aciklama" But you use as "Aciklama5".
HaberKodu is an Attribute and Aciklama is an Element. Is this the process to set an Attribute value of an Element by using SQL Statement?
On my opinion please check the SQL Statement.

This article has been dead for over six months. Start a new discussion instead.