473,787 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the best way to load this tree (c# & sql question)

D
Say you have three tables apples, oranges and bananas and each table has a
different amount of fields that are obviously particular to that type of
fruit. Now I want to load them into a form based tree control with each
table having it's own separate node.

In the tree load function what I did was create three sql data readers and
manually iterate through adding the nodes and related info. While this works
I was wondering if there was a better method.

I was playing around with this code sample from codeproject.com where the
author sets the tree's data source to a dataview and creates node grouping
but that cannot apply here because there can only be one data source for the
tree and not three connected to the three primary nodes (apples, oranges and
bananas) And second it won't work because I don't have a sql statement
that'll return a single set of data that contains all of the data. I tried
unions but due to the unequal amount of fields it's not working out for me.

So is what I've done good enough?

Thanks
Nov 16 '05 #1
1 1390
sounds good enough to me on the surface. If you are worried about
performance and memory, then one good approach is to use a weak reference to
hold the tree in memory. That will economize on memory space and load time.
You can find more about weakreference on MSDN.

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_______________ __________
"D" <Da**@nothing.n et> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Say you have three tables apples, oranges and bananas and each table has a
different amount of fields that are obviously particular to that type of
fruit. Now I want to load them into a form based tree control with each
table having it's own separate node.

In the tree load function what I did was create three sql data readers and
manually iterate through adding the nodes and related info. While this
works I was wondering if there was a better method.

I was playing around with this code sample from codeproject.com where the
author sets the tree's data source to a dataview and creates node grouping
but that cannot apply here because there can only be one data source for
the tree and not three connected to the three primary nodes (apples,
oranges and bananas) And second it won't work because I don't have a sql
statement that'll return a single set of data that contains all of the
data. I tried unions but due to the unequal amount of fields it's not
working out for me.

So is what I've done good enough?

Thanks

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2205
by: qwweeeit | last post by:
Hi all, I am developing in Python (as a GUI I choosed Qt). To increase my expertise, besides reading manuals & tutorials, I am studying a big program developed in the language of my choice, and related with my project (to develop a card game). For that reason I choosed PySol (also if the GUI part uses Tkinter and not Qt). PySol is made up from almost 100 python modules and for that reason you need a mean to organize that. I developed...
0
2611
by: ALI | last post by:
hi i need some best answer's for this question for interview as an oracle (DBA). Q : what is the most difficult situation u faced and how did u solved it ???? i really appriciate if some body helps me . thanks
24
2966
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been reading several old posts/threads on the subject, and they never end with a conclusion (people keep correcting each other and disagreeing).
0
1626
by: DT | last post by:
We have service oriented architecture that comprises of a number of Win2k/IIS boxes. Some of these web service applications access an AS400 system for data acess (We are using HitSoftware's Ritmo .net native driver). For fail over we route these requests through a hardware based load balancer (BigIP). The BigIP allows us to fail over to a secondary AS400 system in case the primary one fails.
1
1020
by: Rashad Rivera | last post by:
What is the best practice for querying, inserting and deleting from a SQL 2000 database from high traffic ASP.NET web forms? Is it to have the SqlConnection & SqlCommand object initialized and stored globally in the Application object, or is it to dynamically create and destroy them with every visit to the web forms? I am seeing a serious problem with performance when I got to over 1000 users consecutively. I estimate a usage of over...
0
2114
by: SeanGallavan | last post by:
Our Environment: Two network load balanced (using Microsoft NLB software) webservers with session maintained in a SQL Server database. NLB is configured with no affinity settings and two network cards in each machine. Machine keys are identical on both webservers. There is no anti-virus software installed. SQL Server database is storing session information as specified by Microsoft guidelines.
2
2687
by: tonokio | last post by:
I wasn't sure if this was the best place to post since there isn't really an algorithm section for programming. I was curious that if you're given a MST tree of G and P is the shortest path between two nodes s and t. If we increaset the cost of each edge of G by some amount x, would P still be the shortest path between s and t, because all the values are incremented by x amount or would it change?
1
1025
by: sianan | last post by:
I am having a problem with the TreeView control. What I am trying to do, *should* be simple. When the user selects a node in my TreeView, I first check to see if the data for the object referenced by that node has changed. If it has, I want to give the user the option of either selecting the next node in the tree, or canceling, in which case the next node is not selected. The tree remains as it was, with the original node selected. (I...
6
2937
by: sck10 | last post by:
Hello, I have applications that produce the following error when they have been open to long without activity. Is there any way to force a re-load of the page or go to another page if the page has expired instead of getting the error? Thanks,
2
2870
by: JamesDelaney | last post by:
Hi all, I'm creating a number of fragments to calculate various presence numbers. I'm creating variables from the results of these fragments then doing simple math to give the results. I'm having an error when trying to add two variables (from the result-tree-fragment) when one variable has no value at all. In the source XML, the criteria returns no matches, so when the two variables are added, it returns NaN. I'm Trying to make a...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.