I would take suggestions from C # and VB.NET.
I use LINQ to query data. I am trying to query the parent and count the child tags.
Here is the column table of my tags:
TagId (int primary)
TagName
ParentId (int Allow NULL referred to TagId column)
Here are some sample data:
TagId, TagName, ParentId
1, Web Design, NULL
2, HTML, 1
3, Programming, NULL
4, CSS 3, 1
Question 1 . In my query result, I want to query all parent tags with the sum of child tags. Something like the following:
Web Design (2 sub tags)
Programming (0 sub tags)
Question 2: If the child tag also has its own child tag
Here are some sample data:
TagId, TagName, ParentId
1, Web Design, NULL
2, HTML, 1
3, Programming, NULL
4, CSS 3, 1
5, HTML 4, 2
6, HTML 5, 2
Desired query result:
Web Design (4 sub tags)
Programming (0 sub tags)
Question number 2 is optional, but it will be very good if you also give some suggestion. Thank.