RSS Forums RSS

[HELP] Please Check this thread its urgent!

Please support our VB.NET advertiser: DiscountASP.NET – 3 Months Free on VB.NET Web Hosting
Reply
Posts: 24
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Newbie Poster

[HELP] Please Check this thread its urgent!

  #1  
Nov 21st, 2008
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.
Private Sub SaveTree(ByRef Treeview As Telerik.WinControls.UI.RadTreeView)

        For Each Node As Telerik.WinControls.UI.RadTreeNode In Treeview.Nodes
            SaveNode(Node)
        Next

    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!!!"
AddThis Social Bookmark Button
Reply With Quote  
Posts: 4,111
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 458
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

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

  #2  
Nov 21st, 2008
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the VB.NET Forum
Views: 432 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:14 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC