Click here to Skip to main content
15,885,435 members
Home / Discussions / C#
   

C#

 
AnswerRe: Who can help me with this C# Project. Pin
Matt T Heffron13-Feb-14 7:15
professionalMatt T Heffron13-Feb-14 7:15 
GeneralRe: Who can help me with this C# Project. Pin
horoz07413-Feb-14 7:20
horoz07413-Feb-14 7:20 
QuestionRe: Who can help me with this C# Project. Pin
thatraja13-Feb-14 7:29
professionalthatraja13-Feb-14 7:29 
AnswerRe: Who can help me with this C# Project. Pin
horoz07413-Feb-14 7:32
horoz07413-Feb-14 7:32 
GeneralRe: Who can help me with this C# Project. Pin
thatraja13-Feb-14 7:47
professionalthatraja13-Feb-14 7:47 
QuestionDropDownlist keeps disappearing Pin
vkEE13-Feb-14 5:47
vkEE13-Feb-14 5:47 
SuggestionRe: DropDownlist keeps disappearing Pin
Richard MacCutchan13-Feb-14 7:03
mveRichard MacCutchan13-Feb-14 7:03 
QuestionOut of Memory error while generating TreeView Pin
Member 768043413-Feb-14 2:04
Member 768043413-Feb-14 2:04 
Hi All,

I am facing "Out of Memory" issue when I am populating TreeView hierarchy using XML. Our XML structure is very complex and it is not in fix format. There are multiple level of child nodes. I am using recursion to iterate XML and populate TreeView structure. I tried to call GC.Collect() to clear memory but still it is throwing same error.
I am using C# of .NET framework 3.5 for development.

I will appreciate if you can help me to find solution for this.

I'm providing the Code, Which I'm using for populating the treeview, below

private void addTreeNode(XmlNode xmlNode, TreeNode treeNode)
{
string attribute = "";

treeView1.ImageList = imageList1;
treeViewResponse.ImageList = imageList1;
XmlNode xNode;
TreeNode tNode;
XmlNodeList xNodeList;
foo.MoveToFollowing(XPathNodeType.Element);
namespaces1 = foo.GetNamespacesInScope(XmlNamespaceScope.All);
if (xmlNode.HasChildNodes)
{

treeNode.ImageIndex = 0;
treeNode.SelectedImageIndex = 0;
xNodeList = xmlNode.ChildNodes;
for (int x = 0; x <= xNodeList.Count - 1; x++)
{
xNode = xmlNode.ChildNodes[x];
treeNode.Nodes.Add(new TreeNode(xNode.Name));
tNode = treeNode.Nodes[x];
//treeNode.Nodes[x].ImageIndex = -1;
addTreeNode(xNode, tNode);
}
}
else
{
treeNode.ImageIndex = 1;
treeNode.NodeFont = new Font("Arial", 8, FontStyle.Bold);
treeNode.SelectedImageIndex = 1;
treeNode.Text = xmlNode.OuterXml.Trim();
}
}

Thanks in advance.

Regards,
Rajeev
AnswerRe: Out of Memory error while generating TreeView Pin
Dave Kreskowiak13-Feb-14 2:35
mveDave Kreskowiak13-Feb-14 2:35 
AnswerRe: Out of Memory error while generating TreeView Pin
Eddy Vluggen13-Feb-14 2:59
professionalEddy Vluggen13-Feb-14 2:59 
AnswerRe: Out of Memory error while generating TreeView Pin
BillWoodruff13-Feb-14 3:24
professionalBillWoodruff13-Feb-14 3:24 
QuestionNumericString Sort Pin
Member 1059316812-Feb-14 20:52
Member 1059316812-Feb-14 20:52 
AnswerRe: NumericString Sort Pin
V.12-Feb-14 21:37
professionalV.12-Feb-14 21:37 
GeneralRe: NumericString Sort Pin
harold aptroot12-Feb-14 22:39
harold aptroot12-Feb-14 22:39 
AnswerRe: NumericString Sort Pin
DaveyM6912-Feb-14 23:37
professionalDaveyM6912-Feb-14 23:37 
AnswerRe: NumericString Sort Pin
Richard Deeming13-Feb-14 0:50
mveRichard Deeming13-Feb-14 0:50 
QuestionHow to Serialize & De-Serialize Any Controls Property in C# Pin
Tridip Bhattacharjee12-Feb-14 20:26
professionalTridip Bhattacharjee12-Feb-14 20:26 
AnswerRe: How to Serialize & De-Serialize Any Controls Property in C# Pin
BillWoodruff12-Feb-14 22:57
professionalBillWoodruff12-Feb-14 22:57 
QuestionWhat is the difference between JavaScript 'var' and C# 'dynamic' Pin
Sanju Uthaiah Bollera12-Feb-14 20:08
Sanju Uthaiah Bollera12-Feb-14 20:08 
AnswerRe: What is the difference between JavaScript 'var' and C# 'dynamic' Pin
Richard MacCutchan12-Feb-14 21:41
mveRichard MacCutchan12-Feb-14 21:41 
AnswerRe: What is the difference between JavaScript 'var' and C# 'dynamic' Pin
BillWoodruff12-Feb-14 22:40
professionalBillWoodruff12-Feb-14 22:40 
Questiondatagridview combobox Pin
abdul rafi12-Feb-14 19:29
abdul rafi12-Feb-14 19:29 
AnswerRe: datagridview combobox Pin
Eddy Vluggen13-Feb-14 9:06
professionalEddy Vluggen13-Feb-14 9:06 
Question3D Model Pin
Kadam dIgambar12-Feb-14 18:07
Kadam dIgambar12-Feb-14 18:07 
SuggestionRe: 3D Model Pin
Richard MacCutchan12-Feb-14 21:39
mveRichard MacCutchan12-Feb-14 21: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.