The WinForms TreeView doesn't support binding the way a DataGridView does. You can't just set a DataSource property and have it all done for you. You need to simply loop through the Rows of the DataTable and, for each one, Add a TreeNode to the Nodes of the TreeView. I would suggest that you should create all the nodes and add them to an array first and then call AddRange to add them all in one go.
csharp Code:
var nodes =
new TreeNode
[table.
Rows.
Count] {};
for (var i = 0; i < table.Rows.Count; i++)
{
var row = table.Rows(i);
nodes
(i
) =
new TreeNode
(...
);
}
tree.Nodes.AddRange(nodes);
You could also use a bit of LINQ to simplify the code but you really should understand this way first before hiding the details behind LINQ.