Blog Stats
  • Posts - 170
  • Articles - 4
  • Comments - 54
  • Trackbacks - 7

 

Tree structures in ASP.NET and SQL Server

This article looks at one way to represent trees in .NET - and how to map them to a table in SQL Server and back again - which should hopefully take the pain out of storing trees and manipulating them from .NET. Our aim will be to create an ASP.NET page that provides some standard "web directory" features including

  • Breadcrumbs
  • Listing sub-nodes in the current section
  • Indicating some of the children of these child nodes

whilst ensuring that we have zero limitations on the number of items in the tree, or its depth.

A diagram displaying the structure of the table, with these fields: id (int, primary key), parentId (int), name (varchar), depth (int), lineage (varchar).

 

Comments have been closed on this topic.
 

 

Copyright © Paschal L