0
<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 by Dani: Formatting fixed

2
Contributors
3
Replies
39
Views
3 Years
Discussion Span
Last Post by Shark_1
0
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?

1

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.