Click here to Skip to main content
16,006,707 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to add toolbars in datagrid? Pin
Member 223436015-Sep-05 18:35
Member 223436015-Sep-05 18:35 
QuestionDirectory List in VB.Net Pin
Anonymous15-Sep-05 18:32
Anonymous15-Sep-05 18:32 
AnswerRe: Directory List in VB.Net Pin
rwestgraham15-Sep-05 18:49
rwestgraham15-Sep-05 18:49 
QuestionLoad report failed Pin
Swiss Mantoro15-Sep-05 18:20
Swiss Mantoro15-Sep-05 18:20 
AnswerRe: Load report failed Pin
Dave Kreskowiak16-Sep-05 1:50
mveDave Kreskowiak16-Sep-05 1:50 
QuestionTree View Problem Pin
nitin_ion15-Sep-05 18:11
nitin_ion15-Sep-05 18:11 
AnswerRe: Tree View Problem Pin
Dave Kreskowiak16-Sep-05 1:45
mveDave Kreskowiak16-Sep-05 1:45 
GeneralRe: Tree View Problem Pin
nitin_ion16-Sep-05 3:16
nitin_ion16-Sep-05 3:16 
I have solved it Here's the code:

Protected Function RecursiveQuery(ByVal ParentID As String)
Dim strSelect As String
strSelect = "select R.RE_Child,D.RE_entities_Name as Child from Relation_Detail R,Relation_Master D where R.RE_Child=D.Relation_Master_code and RE_Parent='" & ParentID & "'"
Dim con As SqlClient.SqlConnection = New SqlClient.SqlConnection("workstation id=localhost;packet size=4096;user id=sa;data source=localhost;persist security info=False;initial catalog=Test")
Dim sqcmdRecursive As SqlCommand = New SqlCommand(strSelect, con)
Dim strParentID As String
Dim strChildID As String
Dim sqrd As SqlDataReader
Dim tvCreate As TreeNode

Try
If con.State = ConnectionState.Closed Then
con.Open()
End If
sqrd = sqcmdRecursive.ExecuteReader

While sqrd.Read
arParent.Add(ParentID)
strChildID = sqrd.Item(0)
If ParentID.Equals("0") Then
ParentNode = New TreeNode(ParentID).Nodes.Add(sqrd.Item(1))
ParentNode.Tag = sqrd.Item(0)
PasteImages(ParentNode, sqrd.Item(0))
TreeView1.Nodes.Add(ParentNode)
ElseIf shFlag = 1 Then
ParentNode = New TreeNode(ParentID)
Dim NewNode As TreeNode
NewNode = New TreeNode(sqrd.Item(1))
NewNode.Tag = sqrd.Item(0)
PasteImages(newnode, sqrd.Item(0))
Add2Node(TreeView1.Nodes, ParentNode, NewNode)
Else
ParentNode = New TreeNode(ParentID)
Dim NewNode As TreeNode
NewNode = New TreeNode(sqrd.Item(1))
NewNode.Tag = sqrd.Item(0)
PasteImages(newnode, sqrd.Item(0))
Add2Node(TreeView1.Nodes, ParentNode, NewNode)
End If
RecursiveQuery(sqrd.Item(0))
End While
Catch ex As Exception
MsgBox(ex.ToString)
Finally
con.Close()
shFlag = 1
End Try
End Function

Private Function Add2Node(ByVal TestNode As TreeNodeCollection, ByVal findnode As TreeNode, ByVal newnode As TreeNode) As Boolean
Dim n As TreeNode
For Each n In TestNode

If n.Tag = findnode.Text Then
n.Nodes.Add(newnode)
Add2Node = True
Exit Function
End If
Add2Node(n.Nodes, findnode, newnode)
Next
End Function
GeneralRe: Tree View Problem Pin
nitin_ion16-Sep-05 3:17
nitin_ion16-Sep-05 3:17 
QuestionFilling a database from an existing vb.net form Pin
Anonymous15-Sep-05 12:20
Anonymous15-Sep-05 12:20 
AnswerRe: Filling a database from an existing vb.net form Pin
Christian Graus15-Sep-05 14:25
protectorChristian Graus15-Sep-05 14:25 
AnswerRe: Filling a database from an existing vb.net form Pin
Briga15-Sep-05 22:55
Briga15-Sep-05 22:55 
Questionvb.net Pin
Anonymous15-Sep-05 8:32
Anonymous15-Sep-05 8:32 
AnswerRe: vb.net Pin
Steve Pullan15-Sep-05 14:19
Steve Pullan15-Sep-05 14:19 
QuestionPlease Help Pin
Member 1208285415-Sep-05 8:09
Member 1208285415-Sep-05 8:09 
AnswerRe: Please Help Pin
Christian Graus15-Sep-05 11:50
protectorChristian Graus15-Sep-05 11:50 
QuestionDataTable/DataAdapter Public - Pros and Cons Pin
dptalt15-Sep-05 3:06
dptalt15-Sep-05 3:06 
AnswerRe: DataTable/DataAdapter Public - Pros and Cons Pin
Christian Graus15-Sep-05 11:55
protectorChristian Graus15-Sep-05 11:55 
GeneralRe: DataTable/DataAdapter Public - Pros and Cons Pin
dptalt16-Sep-05 2:05
dptalt16-Sep-05 2:05 
QuestionUpdate Problem Pin
mcgann15-Sep-05 2:51
mcgann15-Sep-05 2:51 
AnswerRe: Update Problem Pin
Christian Graus15-Sep-05 11:56
protectorChristian Graus15-Sep-05 11:56 
QuestionBarCode Pin
albCode14-Sep-05 21:40
albCode14-Sep-05 21:40 
AnswerRe: BarCode Pin
risepop15-Sep-05 0:33
risepop15-Sep-05 0:33 
QuestionConnecting to internet through code Pin
ciacia14-Sep-05 21:30
ciacia14-Sep-05 21:30 
AnswerRe: Connecting to internet through code Pin
LeenaSo14-Sep-05 22:13
LeenaSo14-Sep-05 22:13 

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.