Click here to Skip to main content
15,910,981 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fill DataSet with two tables Pin
Rahul DSG30-Jul-09 19:24
Rahul DSG30-Jul-09 19:24 
GeneralRe: Fill DataSet with two tables Pin
Mike Ellison3-Aug-09 6:44
Mike Ellison3-Aug-09 6:44 
GeneralRe: Fill DataSet with two tables Pin
Rahul DSG3-Aug-09 20:09
Rahul DSG3-Aug-09 20:09 
GeneralRe: Fill DataSet with two tables Pin
Mike Ellison4-Aug-09 2:44
Mike Ellison4-Aug-09 2:44 
GeneralRe: Fill DataSet with two tables Pin
Rahul DSG6-Aug-09 18:14
Rahul DSG6-Aug-09 18:14 
AnswerRe: Fill DataSet with two tables Pin
PIEBALDconsult30-Jul-09 4:23
mvePIEBALDconsult30-Jul-09 4:23 
Questionclosin a form in application hangs the application or closes the applcn Pin
Vivek Vijayan30-Jul-09 2:48
Vivek Vijayan30-Jul-09 2:48 
Questiona performance problem Pin
reilak30-Jul-09 2:37
reilak30-Jul-09 2:37 
Hi all...
I'm writing a program that passes on an XML file and present it on a treeView.
For some reason the application preform the task vary slow: for a 440K XML file the application needs a full minute and a half to present the tree!!, now I have a good computer and other XML readers I use read the 440K file in a second, so it's probably something I do wrong, I just don't know what.

here is the function that passes on the XML file and adds tree nodes.
private void AddNodesToTree(XmlNode currentXMLNode, TreeNode currentTreeNode)
{

    // Loop through the XML nodes until the leaf is reached.
    // Add the nodes to the TreeView during the looping process.
    if (currentXMLNode.HasChildNodes == true)
    {
        XmlNodeList XMLChildNodeList = currentXMLNode.ChildNodes;
        XmlNode XMLChildNode;
        TreeNode TreeChildNode;
        int NodeIndex = 0;

        for (int i = 0; i < XMLChildNodeList.Count; i++)
        {
            if ((XMLChildNodeList.Item(i).GetType().ToString() != "System.Xml.XmlComment") && 
                (XMLChildNodeList.Item(i).GetType().ToString() != "System.Xml.XmlText"))
            {
                XMLChildNode = currentXMLNode.ChildNodes[i];

                if (XMLChildNode.Attributes.Count != 0)
                {
                   currentTreeNode.Nodes.Add(XMLChildNode.Attributes.Item(0).InnerText);
                }
                else
                {
                   currentTreeNode.Nodes.Add(XMLChildNode.Name);
                }

                TreeChildNode = currentTreeNode.Nodes[NodeIndex];
                NodeIndex++;
                AddNodesToTree(XMLChildNode, TreeChildNode);
            }
        }
    }
    else
    {
        // Here you need to pull the data from the XmlNode based on the
        // type of node, whether attribute values are required, and so forth.
        currentTreeNode.Text = (currentXMLNode.OuterXml).Trim();
    }
}


Thanks, Jimmy
AnswerRe: a performance problem Pin
Nagy Vilmos30-Jul-09 4:07
professionalNagy Vilmos30-Jul-09 4:07 
GeneralRe: a performance problem Pin
reilak30-Jul-09 4:27
reilak30-Jul-09 4:27 
GeneralRe: a performance problem Pin
Nagy Vilmos30-Jul-09 4:32
professionalNagy Vilmos30-Jul-09 4:32 
GeneralRe: a performance problem Pin
reilak30-Jul-09 4:37
reilak30-Jul-09 4:37 
AnswerRe: a performance problem Pin
PIEBALDconsult30-Jul-09 4:26
mvePIEBALDconsult30-Jul-09 4:26 
AnswerRe: a performance problem (UPDATE) Pin
reilak30-Jul-09 4:33
reilak30-Jul-09 4:33 
GeneralRe: a performance problem (UPDATE) Pin
Luc Pattyn30-Jul-09 13:50
sitebuilderLuc Pattyn30-Jul-09 13:50 
AnswerRe: a performance problem, (check this out) Pin
reilak1-Aug-09 22:16
reilak1-Aug-09 22:16 
QuestionConverting HTML File to Excel File and XML File using c# Code Pin
shavil30-Jul-09 2:35
shavil30-Jul-09 2:35 
AnswerRe: Converting HTML File to Excel File and XML File using c# Code Pin
Mike Ellison30-Jul-09 2:57
Mike Ellison30-Jul-09 2:57 
QuestionDouble click custom controls Pin
Jon Henry30-Jul-09 2:27
Jon Henry30-Jul-09 2:27 
AnswerRe: Double click custom controls Pin
Mike Ellison30-Jul-09 2:36
Mike Ellison30-Jul-09 2:36 
GeneralRe: Double click custom controls Pin
Jon Henry30-Jul-09 12:20
Jon Henry30-Jul-09 12:20 
AnswerRe: Double click custom controls Pin
Jon Henry2-Aug-09 1:44
Jon Henry2-Aug-09 1:44 
QuestionConnecting to MySQL from PC Pin
MarkB77730-Jul-09 2:08
MarkB77730-Jul-09 2:08 
AnswerRe: Connecting to MySQL from PC Pin
stancrm30-Jul-09 2:25
stancrm30-Jul-09 2:25 
AnswerRe: Connecting to MySQL from PC Pin
spalanivel30-Jul-09 2:34
spalanivel30-Jul-09 2:34 

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.