Click here to Skip to main content
15,905,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: Compare picturebox.image with image from a resource file Pin
Anindya Chatterjee19-Apr-10 1:45
Anindya Chatterjee19-Apr-10 1:45 
GeneralRe: Compare picturebox.image with image from a resource file Pin
dizzyJ19-Apr-10 2:03
dizzyJ19-Apr-10 2:03 
GeneralRe: Compare picturebox.image with image from a resource file Pin
Anindya Chatterjee19-Apr-10 2:50
Anindya Chatterjee19-Apr-10 2:50 
GeneralRe: Compare picturebox.image with image from a resource file Pin
dizzyJ19-Apr-10 3:07
dizzyJ19-Apr-10 3:07 
AnswerRe: Compare picturebox.image with image from a resource file Pin
sadiq_arbaoui17-Jan-11 23:07
sadiq_arbaoui17-Jan-11 23:07 
QuestionManipulate XML Pin
NarVish18-Apr-10 23:32
NarVish18-Apr-10 23:32 
AnswerRe: Manipulate XML Pin
NavnathKale19-Apr-10 0:00
NavnathKale19-Apr-10 0:00 
GeneralRe: Manipulate XML Pin
NarVish19-Apr-10 1:13
NarVish19-Apr-10 1:13 
Thanks for the reply. Please look at my code. I'm getting exception at below line.
xmlDoc.DocumentElement.InsertAfter(newcatalogentry, refNode);
Exception message: "The reference node is not a child of this node."

XmlTextReader xmlReader = new XmlTextReader(Application.StartupPath + "\\doc.xml");
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlReader);
            xmlReader.Close();

            string xpath = string.Format("/StudentRecords/Student");
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
            XmlNodeList fieldNodes = xmlDoc.SelectNodes(xpath, nsmgr);
            string refName = "";
            int index = 0;
            XmlAttributeCollection ddd;
            XmlNode refNode = null;
            string studentID;
            foreach (XmlNode node in fieldNodes)
            {
                ddd = fieldNodes[index].Attributes;
                studentID = ddd["ID"].Value.ToString();
                
                if (Convert.ToInt32(studentID) == 101)
                {
                    refNode = node.SelectSingleNode("StudentSubject");
                }
            }
            XmlDocument xmldoc = new XmlDocument();
            XmlElement newcatalogentry = xmldoc.CreateElement("StudentMarks");
            XmlAttribute newcatalogattr = xmldoc.CreateAttribute("Total");

            newcatalogattr.Value = "100";

            // Attach the attribute to the XML element
            newcatalogentry.SetAttributeNode(newcatalogattr);



            // New XML element inserted into the document
            xmlDoc.DocumentElement.InsertAfter(newcatalogentry, refNode);
            string path = "C:\\test.xml";
            FileStream fsxml = new FileStream(path, FileMode.Truncate,
                                              FileAccess.Write,
                                              FileShare.ReadWrite);
            xmlDoc.Save(path);

GeneralRe: Manipulate XML Pin
NavnathKale19-Apr-10 2:08
NavnathKale19-Apr-10 2:08 
GeneralRe: Manipulate XML Pin
NarVish19-Apr-10 3:11
NarVish19-Apr-10 3:11 
GeneralRe: Manipulate XML Pin
NarVish19-Apr-10 19:13
NarVish19-Apr-10 19:13 
GeneralRe: Manipulate XML Pin
NavnathKale19-Apr-10 21:48
NavnathKale19-Apr-10 21:48 
GeneralRe: Manipulate XML Pin
NarVish19-Apr-10 23:34
NarVish19-Apr-10 23:34 
GeneralRe: Manipulate XML Pin
NavnathKale20-Apr-10 0:58
NavnathKale20-Apr-10 0:58 
GeneralRe: Manipulate XML Pin
NarVish20-Apr-10 1:20
NarVish20-Apr-10 1:20 
GeneralRe: Manipulate XML Pin
NavnathKale20-Apr-10 1:21
NavnathKale20-Apr-10 1:21 
QuestionHow to put large text data (~20mb) into sql cs 3.5 database? Pin
Anindya Chatterjee18-Apr-10 21:42
Anindya Chatterjee18-Apr-10 21:42 
AnswerRe: How to put large text data (~20mb) into sql cs 3.5 database? Pin
Ashfield18-Apr-10 22:16
Ashfield18-Apr-10 22:16 
GeneralRe: How to put large text data (~20mb) into sql cs 3.5 database? Pin
Anindya Chatterjee18-Apr-10 22:28
Anindya Chatterjee18-Apr-10 22:28 
GeneralRe: How to put large text data (~20mb) into sql cs 3.5 database? Pin
Ashfield18-Apr-10 22:43
Ashfield18-Apr-10 22:43 
GeneralRe: How to put large text data (~20mb) into sql cs 3.5 database? Pin
Md. Marufuzzaman19-Apr-10 0:09
professionalMd. Marufuzzaman19-Apr-10 0:09 
GeneralRe: How to put large text data (~20mb) into sql cs 3.5 database? Pin
Anindya Chatterjee19-Apr-10 0:41
Anindya Chatterjee19-Apr-10 0:41 
QuestionMFC to C# HELP ? Pin
Nematjon Rahmanov18-Apr-10 20:16
Nematjon Rahmanov18-Apr-10 20:16 
AnswerRe: MFC to C# HELP ? Pin
Jimmanuel19-Apr-10 4:08
Jimmanuel19-Apr-10 4:08 
QuestionNetwork Scanning Pin
satsumatable18-Apr-10 19:39
satsumatable18-Apr-10 19:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.