I have my category hiearchy stored within a table called categories. What I need to do is display the actual category hiearchy with a single sql statement. For example: I have the following data in the table category | category_no | category_above --------------------------------------------------- Computers | 1 | 0 Dell | 24 | 1 Sony | 48 | 1 Pentium 4 | 33 | 24 Pentium 4 | 85 | 48 How would i query a database to sort the records as follows (in the category hierarchy)? Computers, Dell, Pentium 4, Sony, Pentium 4 so i could then generate text that looks like Computers -->Dell ----->Pentium 4 -->Sony ----->Pentium 4 Anyone have any ideas? Right now I have a function that loops through, but the problem is it's using too many resources...I have to open a database connection each time i loop through. So if I had 500 categories i'd be opening 500 database connections, which i don't want. Any help?
tech untouchable
Posts
-
Looping Through Table Display Category Hierarchy -
Highlighting a Row in a DatagridI need to Highlight a Row in a datagrid based on the user input. For example when someone adds an item to their shopping cart...I would like for the row in the cart to be highlighted. So this way they know that this item was added to their shopping cart. So far I've found how to change the color of a row... dgrdSelect.items.item(0).backcolor = System.Drawing.Color.yellow ...but I need to find the row based on the product number. For example I've tried many variations like: dgrdselect.items.item(dgrdselect.items.itemindex.findbyvalue("401")).backcolor = System.Drawing.Color.Yellow But that didn't seem to work... The control that I would like to findbyvalue is "Product_no" So basically highlight the row where product_no=401. Anyone ever do this before? Thanks, jordan
-
Disabling asp:button after submitted or pressedI've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan