TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash Malakar
NA
13
4.8k
saving data in datatable using recursive function
Apr 23 2015 1:21 AM
In the below function I have a DataTable which resets during recursion of the function. How can I solve this problem?
I have to create table once and add rows repeatedly in each repeat of the function.
Please help!
private DataTable GetSelectedTreeNodes(TreeNode parentTreeNode)
{
DataTable tvp = new DataTable();
tvp.Columns.Add(new DataColumn("Suburb"));
if (parentTreeNode.Checked)
{
ListBox1.Items.Add(parentTreeNode.Text);
tvp.Rows.Add(parentTreeNode.Text);
tvp.Rows.Add(parentTreeNode.Text);
}
if (parentTreeNode.ChildNodes.Count > 0)
{
foreach (TreeNode childTreeNode in parentTreeNode.ChildNodes)
{
GetSelectedTreeNodes(childTreeNode);
}
}
return tvp;
}
Reply
Answers (
2
)
How to pass the resr Api url with the header to return json
Multiple webpage at a time