Click here to Skip to main content
16,004,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: problem uploading file Pin
eyes200724-Sep-07 22:27
eyes200724-Sep-07 22:27 
AnswerRe: problem uploading file Pin
Guffa24-Sep-07 23:38
Guffa24-Sep-07 23:38 
GeneralRe: problem uploading file Pin
eyes200724-Sep-07 23:40
eyes200724-Sep-07 23:40 
QuestionCrystal reports without using database/dataset in vb.net 2005 Pin
vilasvishu24-Sep-07 20:43
vilasvishu24-Sep-07 20:43 
AnswerRe: Crystal reports without using database/dataset in vb.net 2005 Pin
Jens Meyer24-Sep-07 21:30
Jens Meyer24-Sep-07 21:30 
GeneralRe: Crystal reports without using database/dataset in vb.net 2005 Pin
vilasvishu24-Sep-07 21:55
vilasvishu24-Sep-07 21:55 
GeneralRe: Crystal reports without using database/dataset in vb.net 2005 Pin
darkelv24-Sep-07 23:41
darkelv24-Sep-07 23:41 
QuestionPopulating Treeview using DataTable [modified] Pin
klaydze24-Sep-07 18:57
klaydze24-Sep-07 18:57 
hi, i have a little problem in populating my TreeView. i already populated all the Parent Node and its corresponding Child Node orderly. the problem is, when my form load where the treeview is place this is the output.



i attached the picture to be able to understand well because my english is not that good. sorry for that. but anyway the ordering of the Parent and Child Node is correct. what i want is all the child node of the specific parent node will under it.

this is my code

Dim DA As clsDataAccess
Dim DA2 As clsDataAccess
Dim DT As DataTable
Dim DT2 As DataTable

Dim i As Integer
Dim nRow As Integer
Dim nRow2 As Integer

Dim strParent As String
Dim strChild As String
Dim intParent As String
Try
DA = New clsDataAccess
DT = DA.ExecQuery("SELECT DISTINCT(tblMicromixParentNode.intParentNodeID), dbo.tblMicromixParentNode.vchrDescription AS " & _
"vchrParentDesc,dbo.tblMicromixParentNOde.intOrder FROM dbo.tblMicromixMenu INNER JOIN dbo.tblMicromixParentNode ON " & _
"dbo.tblMicromixMenu.intParentNodeID = dbo.tblMicromixParentNode.intParentNodeID ORDER BY intOrder ASC")

If DT.Rows.Count > 0 Then
Dim PNode As Windows.Forms.TreeNode
TV.Nodes.Clear()

For nRow = 0 To DT.Rows.Count - 1
intParent = DT.Rows(nRow).Item("intParentNodeID")
strParent = DT.Rows(nRow).Item("vchrParentDesc")

PNode = TV.Nodes.Add(strParent)

DA2 = New clsDataAccess
DT2 = DA2.ExecQuery("SELECT t1.*, t2.vchrDescription AS vchrFormDesc, " & _
" t2.vchrFormName AS vchrFormName FROM " & _
" tblMicromixMenu t1 INNER JOIN tblMicromixChildNode " & _
" t2 ON t1.intChildNodeID = t2.intChildNodeID " & _
" where t1.intAccessID=1 and t1.intParentNodeID=" & intParent & " and intShow=1")

If DT2.Rows.Count > 0 Then
Dim CNode As TreeNode

For nRow2 = 0 To DT2.Rows.Count - 1
strChild = DT2.Rows(nRow2).Item("vchrFormDesc")
CNode = TV.Nodes.Add(strChild)
Next
End If

PNode.EnsureVisible()
Next
End If

Catch ex As Exception
MsgBox(ex.ToString)
End Try

by the way i am using vb.net for that.

your reply will be really appreciated.

Thank You.






-- modified at 1:17 Tuesday 25th September, 2007

Don't block the drive way of all the newbies in programming. Smile | :)

AnswerRe: Populating Treeview using DataTable Pin
Dave Kreskowiak25-Sep-07 1:30
mveDave Kreskowiak25-Sep-07 1:30 
GeneralRe: Populating Treeview using DataTable Pin
klaydze25-Sep-07 15:47
klaydze25-Sep-07 15:47 
GeneralRe: Populating Treeview using DataTable Pin
Dave Kreskowiak25-Sep-07 16:12
mveDave Kreskowiak25-Sep-07 16:12 
GeneralRe: Populating Treeview using DataTable Pin
klaydze25-Sep-07 18:47
klaydze25-Sep-07 18:47 
QuestionRunning windows application in LAN Pin
skandaapriya24-Sep-07 18:41
skandaapriya24-Sep-07 18:41 
AnswerRe: Running windows application in LAN Pin
Paras Kaneriya24-Sep-07 19:15
Paras Kaneriya24-Sep-07 19:15 
AnswerRe: Running windows application in LAN Pin
MohammadAmiry24-Sep-07 19:58
MohammadAmiry24-Sep-07 19:58 
AnswerRe: Running windows application in LAN Pin
manni_n25-Sep-07 0:40
manni_n25-Sep-07 0:40 
AnswerRe: Running windows application in LAN Pin
Dave Kreskowiak25-Sep-07 1:24
mveDave Kreskowiak25-Sep-07 1:24 
QuestionDomain server time Pin
Tauseef A24-Sep-07 16:49
Tauseef A24-Sep-07 16:49 
AnswerRe: Domain server time Pin
Dave Kreskowiak24-Sep-07 17:14
mveDave Kreskowiak24-Sep-07 17:14 
GeneralRe: Domain server time Pin
Tauseef A24-Sep-07 17:23
Tauseef A24-Sep-07 17:23 
GeneralRe: Domain server time Pin
Paras Kaneriya24-Sep-07 19:13
Paras Kaneriya24-Sep-07 19:13 
GeneralRe: Domain server time Pin
Dave Kreskowiak25-Sep-07 1:13
mveDave Kreskowiak25-Sep-07 1:13 
QuestionListview Pin
Bso_Cool24-Sep-07 16:47
Bso_Cool24-Sep-07 16:47 
AnswerRe: Listview Pin
Dave Kreskowiak24-Sep-07 17:12
mveDave Kreskowiak24-Sep-07 17:12 
AnswerRe: Listview Pin
Mycroft Holmes24-Sep-07 17:32
professionalMycroft Holmes24-Sep-07 17:32 

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.