943,696 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1072
  • VB.NET RSS
Nov 21st, 2008
0

[HELP] Please Check this thread its urgent!

Expand Post »
Hello all, i have a problem and im in need of your help... I have a treeview with 2 parent Nodes and in the parent nodes there are some node:

Members
     New
     Search
Administration
    Groups
    Photo Location

In all nodes there is a checkbox for a spesific reason, like this:

(checkbox) Members
(checkbox)     New
(checkbox)     Search
(checkbox) Administration
(checkbox)    Groups
(checkbox)    Photo Location

What i want to do is to insert all the info that the treeview has into a Access Database. I can insert all the child nodes of the treeview into the db but i cant insert the Parent Nodes

Here are the funtions that i use to add the child nodes:

1.
VB.NET Syntax (Toggle Plain Text)
  1. Private Sub SaveTree(ByRef Treeview As Telerik.WinControls.UI.RadTreeView)
  2.  
  3. For Each Node As Telerik.WinControls.UI.RadTreeNode In Treeview.Nodes
  4. SaveNode(Node)
  5. Next
  6.  
  7. End Sub

2.
Red = Function that is not included.
Private Sub SaveNode(ByRef TreeNode As Telerik.WinControls.UI.RadTreeNode)
        Dim con As New OleDbConnection
        Dim command As New OleDbCommand
        Dim trans As OleDbTransaction = Nothing
        Dim RightID As Integer
        Dim GroupID As Integer
        Dim InsertString As String

        GroupID = functions.GetInfo(connstring, "SELECT ID FROM Groups WHERE GroupName = '" & cmbProperty.Text & "'", "Group", "ID")

        RightID = functions.GetNextVal(connstring, "Right")
        functions.InsertWithoutMessage(con, connstring, trans, command, "INSERT INTO Rights(ID,RightName) VALUES(" & RightID & ",'" & txtRightName.Text & "')")

        For Each Node As Telerik.WinControls.UI.RadTreeNode In trvForms.Nodes 'TreeNode.Nodes
            InsertString = "INSERT INTO Group_Right_Forms(Group_ID,Right_ID,Form_ID,ShowRight,InsertRight,UpdateRight,DeleteRight) VALUES(" & GroupID & "," & RightID & "," & Node.Tag & "," & Node.Checked.ToString() & "," & GetPanel(Node.Tag).InsertCheck.Checked.ToString() & "," & GetPanel(Node.Tag).UpdateCheck.Checked.ToString() & "," & GetPanel(Node.Tag).DeleteCheck.Checked.ToString() & ")"
            functions.InsertWithoutMessage(con, connstring, trans, command, InsertString)
            For Each Child As Telerik.WinControls.UI.RadTreeNode In Node.Nodes
                SaveNode(Child)
            Next
        Next

    End Sub




WHAT I WANT TO DO IS TO CHANGE SOMETHING SO AS TO INSERT INTO THE DATABASE ALL THE TREE(PARENT AND CHILD).... PLZ ANY CHANGES MADE PLZ MARK THEM WITH RED COLOR SO I CAN UNDERSTAND WHAT HAVE I DONE WRONG...


PS: Answer as soon as possible, as the title says "It is Urgent!!!"
Similar Threads
Reputation Points: 11
Solved Threads: 12
Junior Poster
Alexpap is offline Offline
117 posts
since Sep 2008
Nov 21st, 2008
0

Re: [HELP] Please Check this thread its urgent!

Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,757 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: AttachEventHandler issues
Next Thread in VB.NET Forum Timeline: How to create file in VB.net (VS 2005)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC