Click here to Skip to main content
15,849,306 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Controlling FileSystemWatcher Pin
DSAlbin24-May-06 13:22
DSAlbin24-May-06 13:22 
QuestionDataGrid Control Pin
Quecumber2569-May-06 11:27
Quecumber2569-May-06 11:27 
Questionhandler problem Pin
meconomou9-May-06 9:18
meconomou9-May-06 9:18 
Questioncombo box Data source Nothing Problem Pin
Hkothari779-May-06 9:02
Hkothari779-May-06 9:02 
AnswerRe: Data source Still Nothing Problem Pin
Hkothari779-May-06 9:04
Hkothari779-May-06 9:04 
QuestionHow to cut part of the piture in a picture box Pin
Murtuza Husain Miyan Patel9-May-06 8:58
professionalMurtuza Husain Miyan Patel9-May-06 8:58 
AnswerRe: How to cut part of the piture in a picture box Pin
Christian Graus9-May-06 11:39
protectorChristian Graus9-May-06 11:39 
QuestionAdding nodes to a treeview control Pin
Raistlin21_459-May-06 8:25
Raistlin21_459-May-06 8:25 
Hi,

I've been banging my head on the keyboard for a few days now searching for a solution to my problem. Iv'e searched Google for a solution but I can't seem to find any.

The node information is stored in a MySQL database using the nodes.fullpath command or like this:

lvl1\lvl2\lvl3

Now, I've seen and tried to use the treeview.nodes.add(1).nodes.add(2).nodes.add(3) with a split command but because I don't know how many levels there are before hand this makes a giant select case that makes me cry each time I see it.

I want the routine to check if the level exists then add it if it doesn't and/or move to the next level. (Geez it sounds so simple writen like that...)

Here is the routine I'm using

Dim SQL As String = "Select * from troubleshooting order by node_path asc"<br />
        Dim StrNodePath As String<br />
        Dim nNode As TreeNode<br />
        Dim BolNew As Boolean = True<br />
        Dim X As Integer<br />
        Dim StrNode As String<br />
<br />
<br />
        RSProbleme = ReturnForm.StrConn.Execute(SQL)<br />
<br />
        Do Until RSProbleme.EOF = True<br />
<br />
            StrNodePath = RSProbleme("node_path").Value<br />
            aNodePath = Split(StrNodePath, "\")<br />
<br />
            For X = 0 To UBound(aNodePath)<br />
                BolNew = True<br />
                For Each nNode In TrVProbleme.Nodes<br />
<br />
                    If nNode.Text = aNodePath(X) Then<br />
                        BolNew = False<br />
                    End If<br />
<br />
                Next<br />
                If BolNew = True Then<br />
                    nNode.Nodes.Add(aNodePath(X))   <-- This is the line that gives me trouble<br />
                End If<br />
            Next<br />
<br />
            RSProbleme.MoveNext()<br />
        Loop


When adding it gives me the error, "Object reference not set to an instance of an object." and using the variable watch in VS it says that nNode = Nothing.

Any help will be greatly appreciated. (My head hurts from all that banging...)

Thanks

For every action there is an equal and opposite malfunction
AnswerRe: Adding nodes to a treeview control Pin
digicd19-May-06 17:22
digicd19-May-06 17:22 
GeneralRe: Adding nodes to a treeview control Pin
Raistlin21_4510-May-06 7:01
Raistlin21_4510-May-06 7:01 
AnswerRe: Adding nodes to a treeview control Pin
Hacknight949-May-06 21:37
Hacknight949-May-06 21:37 
GeneralRe: Adding nodes to a treeview control Pin
Raistlin21_4510-May-06 7:05
Raistlin21_4510-May-06 7:05 
GeneralRe: Adding nodes to a treeview control Pin
Hacknight9410-May-06 15:15
Hacknight9410-May-06 15:15 
GeneralRe: Adding nodes to a treeview control Pin
Hacknight9410-May-06 15:21
Hacknight9410-May-06 15:21 
Questionfrom ADO to ADO.NET 2.0 Pin
Gulfraz Khan9-May-06 7:11
Gulfraz Khan9-May-06 7:11 
QuestionHandling Complex Numbers Pin
crtwrght_mrk9-May-06 7:09
crtwrght_mrk9-May-06 7:09 
AnswerRe: Handling Complex Numbers Pin
darkelv9-May-06 7:25
darkelv9-May-06 7:25 
QuestionRe: Handling Complex Numbers Pin
crtwrght_mrk9-May-06 10:34
crtwrght_mrk9-May-06 10:34 
Question&quot;load report failed&quot; error Pin
sarah_chandran9-May-06 6:05
sarah_chandran9-May-06 6:05 
AnswerRe: &amp;quot;load report failed&amp;quot; error Pin
penguin500011-May-06 21:05
penguin500011-May-06 21:05 
Questionhow to export crystal report from vb in pdf format Pin
virendra_sw9-May-06 4:48
virendra_sw9-May-06 4:48 
AnswerRe: how to export crystal report from vb in pdf format Pin
albCode9-May-06 5:07
albCode9-May-06 5:07 
GeneralRe: how to export crystal report from vb in pdf format Pin
virendra_sw9-May-06 20:33
virendra_sw9-May-06 20:33 
Questionneed help on programing methods Pin
Eleazer9-May-06 3:46
Eleazer9-May-06 3:46 
AnswerRe: need help on programing methods Pin
J4amieC9-May-06 4:36
J4amieC9-May-06 4:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.