|
-
Mar 31st, 2004, 05:05 AM
#1
Thread Starter
Junior Member
Loading a CSV file into a treeview is very slow
I have a CSV file with over 6000 records which I am loading into a TreeView cointrol. I use a recursive function to do this becuase I need to look for a key so I can identify where I need to place the entry in the TreeView
For Each sLine As String In UniclassBasic
iCount = iCount + 1
Dim sUniclassAray() As String = Split(sLine, ",")
If sUniclassAray(2) = "Uniclass" Then
sString = sUniclassAray(0) & " " & sUniclassAray(1)
Tree.Nodes.Add(New HalcrowTreeNode(sString, sUniclassAray(0)))
Else
Dim oNode As HalcrowTreeNode
'Call Recursive function
oNode = FindNode(sUniclassAray(2), Tree.Nodes)
If Not oNode Is Nothing Then
sString = sUniclassAray(0) & " " & sUniclassAray(1)
oNode.Nodes.Add(New HalcrowTreeNode(sString, sUniclassAray(0)))
End If
End If
Next
Does anybody have any ideas on where I can improve this code or would it be possible to use the old vb6 control within the Windows common Controls which worked pefectly or is this going to cause me problems furthur down the line.
Thanks in Advance
Daniel Barnes
-
Mar 31st, 2004, 01:50 PM
#2
What Control did you use in vb6?
Did you look at the code that i posted in your previous Thread?
Do you need to keep your data in a CSV? If you used XML parsing would be faster...
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
Apr 1st, 2004, 02:47 AM
#3
Thread Starter
Junior Member
I just used the TreeView control from Windows common controls in VB6.
I did look at your code but to be perfectly honest I had already got it working so didn't look at it in to much detail.
Do you think that code would be much quicker.
I have thought about doing this project with XML but havent used it before. How easy would it be to learn and put in practice.
Thanks Very Much for your help.
Daniel
Last edited by DanielBarnes1; Apr 1st, 2004 at 02:50 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|