Lennie Kuah

Lennie Kuah

  • NA
  • 29
  • 0

( RESOLVED ) VBNET2008 using DataReader to Fill TreeView control at Runtime

Feb 10 2011 9:45 PM

Hullo Good Friends,

I am using

Window Application using VBNET2008, DataReader and TreeView  

I need your help, Please help me.

 

I am trying to use DATAREADER to fill the TreeView control during Runtime

I am using TreeView controls and having problem doing the coding as I have not done it before.

 

Listed beow are the SQL String and the result of it. And also the graphic drawing of TreeView  display  

 

SQL String :

SELECT  OrderID,  OrderDate  ProductID

FROM   Invoices WHERE (CustomerID = 'Chops')  Order by OrderID, Orderdate

 

Part of the 137 rows Result of SQL String

OrderId         OrderDate     ProdID

10254          11/07/1996        74

10254          11/07/1996        24

10254          11/07/1996        55

10254          13/07/1996       203

10254          13/07/1996       112

10370          03/12/1996        74

10370          03/12/1996         1

10370          03/12/1996        64

10370          03/12/1996        56

10519          28/04/1997        10

10519          28/04/1997        60

 

 

TreeView Display Format

Graphic drawing of how it should look like

 

10254  '=è Parent

      11/07/1996 ' =èChild

                74 '=======è GrandChild

                24

                55

      13/07/1996   '=èChild

               203 '====è GrandChild

               112

 

10370 '=è Parent

           03/12/1996   '=èChild

                74  '====è GrandChild

                1

                64

                56
Thank you very much for helping me. Once with your help I got my coding working I will post it here to share with other Newbies who may have similar problem and also an appreciation of your help to share with others.
 
The overall coding are attached as ZIP File
 
 
Cheers,
TeeLeong
 


Answers (1)