|
Thenks for the feedback
In many instances hierarchical is totally not worth looking at and can be a nightmare to manage, but there is a place for it, and when used with an interface to meet a functionality requirement it can be a great advantage.
Expearience has shown that hierarchical data in a single table can be very effective when the user interface mimics that of a file management system to manage the data and you proved breadcumb navigation to go back a level or two.
In short - hierarchical data to more than a few levels is not for the faint hearted and even then you realy need to be sure that you understand what you are getting yourself into. (be prepared for developing some prity elaborate loops and/or non pimple coding)
Sitting on my bookshelf are numerious intermediate level books that show how to use hierarchical data to power .net sitemap and menu controls from a database rather than xml files.
So whilst programming languages like MUMPS have dissapeared there is still a requirement for the strategic use of hierarchical data. The key word being STRATEGIC.
For those who want to investigate things further #IHierarchicalDataSource Interface# can be found at http://msdn.microsoft.com/en-us/library/d3ef7363(v=vs.90).aspx ####
ASP.net 3.5 Unleashed by Stephen Walther Chapter 19 gives a blow by blow example with sample code for binding a menu control directly to the database - a Hierarchical table.
Happy coding
|
|
|
|
|
You may be interested in another way of doing hierarchical data in a table. It looks a bit like this:
Id | ParentId | IdPath | WhateverData |
---|
1 | NULL | 1 | Blah | 2 | 1 | 1_2 | Blah | 3 | 1 | 1_3 | Blah | 4 | NULL | 4 | Blah | 5 | 2 | 1_2_5 | Blah | 6 | 5 | 1_2_5_6 | Blah |
If you include the full path of ID's (the ID and all ancestor ID's), you can reduce the number of queries required to get all descendents of a record. I think newer versions of SQL Server have some ability to query hierarchical data, but this approach will work on all SQL systems.
|
|
|
|
|
Nice alternative, but not sure how easilly it could be used to power a menu control.
With regards to reducing SQL work I can see that it would have benifits.
|
|
|
|
|
:not
as in:
a:not([href]) { color: inherit; text-decoration:none; }
This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline.
I just thought it was eloquent enough to share.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Huh. Useful in some situations, eh?
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
Thanks for this, Chris, I think there could be a lot more to it than is immediately apparent.
The older I get the better I was
mikeo
|
|
|
|
|
Nice. Are there any (*: doesn't work in browser X) conditions on this? I know the conditional selectors generally don't play nicely with IE.
|
|
|
|
|
BobJanova wrote: Are there any (*: doesn't work in browser X) conditions on this
No support on IE8 and earlier, unfortunately.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Bah... No one uses old browsers like that anyway...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
+5, it's nice to see some wonderful code, as oposed to the waves of weirdos...
EDIT: if you can, make this really a OTD series, as a CSS Selector OTD has really a great potential...
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
|
Thanks for posting this, and to CP for hilighting it in their newsletter email today. This is a pretty cool thing that I had not seen before, probably hidden in plain site right in front of me though.
|
|
|
|
|
Is this what you are using to prevent anchored headings in CodeProject articles from being shown in blue instead of orange?
|
|
|
|
|
yeah
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Non-CSS version - as used in Netscape Navigator 4, Internet Explorer 4, and many later browsers:
<a name=...></a>text to be bookmarked
or
<span id=...>text to be bookmarked</span>
|
|
|
|
|
Empty anchors don't always work. They should. They don't.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
From the main form of a simple XSD validator app..
void executeButton_click(object sender, EventArgs e)
{
if (userTooStupid(schema == null, "You gotta load an XSD first, genius.") ||
userTooStupid(fileBrowser1.SelectedFiles.Length == 0, "You've selected zero files. And they're all valid!!"))
return;
bool userTooStupid(bool condition, string insult)
{
if (condition)
MessageBox.Show(insult, "User Too Stupid");
return condition;
}
|
|
|
|
|
And the problem with that is what, exactly?
|
|
|
|
|
I think it isn't too polite when you show a message box to your user which is telling him that he is too stupid .
Just a gues
|
|
|
|
|
Ah, I see - empathy etc. I've heard of that!
|
|
|
|
|
Mark Springsteen wrote: I think it isn't too polite when you show a message box to your user which is telling him that he is too stupid . Is politeness or honesty preferred?
"Replace Application Operator" is sometimes the best advice an application can give.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Is politeness or honesty preferred?
Honesty is important. Why can't you insult your user in a honest way ?
|
|
|
|
|
The user would probably complain that "Too" and "Stupid" should be lowercase only, and that pressing "Tab" button should close the message box.
|
|
|
|
|
Should you do it? All depends if the client is stupid enough to pay you for the work!
|
|
|
|
|