locked
DataRow.GetChildRows() very slow RRS feed

  • Question

  • Hello,

    I'm using DataRow.GetChildRows() to read some data from a DataSet. The problem I have is that GetChildRows() is very slow. Is there any way to change that?

    Here my code:

                ArrayList childNodes = new ArrayList();

                foreach(DataRelation myRelation in dr.Table.ChildRelations)
                {
                    foreach(DataRow myRow in dr.Table.Rows)
                    {
                        foreach (DataRow childRow in myRow.GetChildRows(myRelation))
                        {
                            if (childRow.GetParentRow(myRelation) == dr)
                            {
                                childNodes.Add(new XmlToolNode(childRow));
                            }
                        }
                    }
                }

    Tanks for any help or hint!!
    • Moved by Zhi-Xin Ye Tuesday, September 2, 2008 11:05 AM off topic (Moved from .NET Base Class Library to Off-Topic Posts (Do Not Post Here))
    Friday, August 29, 2008 2:21 PM

Answers