|
It doesn't work because you didn't add your child nodes to any of the existing parent nodes at all. They're all children of the root.
You're using lousy variable names by the way. It's very difficult to figure out what the variable is used for just be glancing at it.
This section of code should be modified:
If DT2.Rows.Count > 0 Then
Dim CNode As TreeNode
For nRow2 = 0 To DT2.Rows.Count - 1
strChild = DT2.Rows(nRow2).Item("vchrFormDesc")
PNode.Nodes.Add(strChild)
Next
End If
You add the children to the parent node you created above it, not to the root of the TreeView nodes collection.
|
|
|
|
|
first of all thank u for the reply sir.
oh yes i see now. my code below is the same so i get an output that they become all Parent Node.
so my problem now is how can i add the child node in a specific parent node? because in vb6 they have Relative,Relationship and Text. which is the Relative is the Parent Node and the Relationship is the word "tvwChild".
how can i convert this line of code in VB6 to .Net
TreeView1.Nodes.Add(Relative,Relationship,Key,Text,Image)
where the Relationship should be "tvwChild"
Parent Node
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)
Child Node
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
sorry for my english.
Thank You.
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
Did you understand the changes I made to your code in my last post?
You add a parent node to the root of the tree. Then you retrieve all the children of that node from the database and add those to the Nodes collection of the Parent you just added.
|
|
|
|
|
oh yes sir i do understand that. i just explaining my previous code.
the code is working now. thank you very much.
i wish you are open again when i have a difficulties in my code.
Thank You.
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
I have a Windows VB.Net Application with MSFoxPro Database, third party controls within it. With all the granted permissions for assemblies and strong name for dll.
I install my App in one system and copy the shortcut key in the other syatem within the LAN. Now if i click on shortcut key it has to fetch the data from the system where I have installed.
Can anyone PLS help me in this.
Very Urgent.
Rekha
|
|
|
|
|
skandaapriya wrote: Now if i click on shortcut key it has to fetch the data from the system where I have installed.
Can anyone PLS help me in this.
what???
what do you want? fetch the data from the machine where your app is installed to the machine where you put the shortcut???
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
You need Client/Server programming. You should write different codes which should run on clients and the server.
Your application should be installed on all machines!
|
|
|
|
|
if i am gettin it correctly then you want to fetch your database to all the lan connected system where ever you have installed your executable file
well this is server client application...
if this is the case,
then i know the procedure for sql and excess , i hope same logic should work.
In the connection string where you are giving path of your database in coding, jst add the ip adress of server like "//ipaddress of server computer/path of database".
and from server computer you have to share the database file.
try this out, may it helps you....
|
|
|
|
|
This is easy. In your code, you have to build the fully qualified path to the folder where the database is. You can do this with something like:
Dim fullPath As String = Path.Combine(Application.StartupPath, "database.mdb")
Or, if the database file is in a subdirectory of the StartupPath:
Dim fullPath As String = Path.Combine(Application.StartupPath, "subfolder\database.mdb")
Other than that, you haven't said what the problem is, nor mentioned any error messages you're getting, so it's very hard to help you.
BTW, mentioning "urgent" in your post tends to get people to ignore you.
|
|
|
|
|
hi guys
i want to get domain servers date and time through my vb.net application,
how can i do that ?
thanks in advance
hello
|
|
|
|
|
Any machine that starts up and is part of the same domain automatically gets it's date/time synced with the domain controller it logs into the domain with. You get the date/time from the workstation, not the domain controller.
|
|
|
|
|
thanks
but what if some one has changed the local system time and because of that my application logic
will not work according to its functionality thats why in my vb.net i am getting the domain
system time .
hello
|
|
|
|
|
Rather you should use UDT.Now()
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
The local domain workstations resync their time with the server every once in a while.
If you're worried about people rolling back the clock because you're giving them a timed trial software, you are simply at the mercy of the clock. There is no way around it that's 100% foolproof.
|
|
|
|
|
I am developing a program that will keep in inventory of items that we have plus I want to be able to write an order for each person individually. I am trying to use a Listview control, but I want to just be able to scroll across and in each row and column edit the quantity to order for each person. But the labeledit property only applies to the first column. I have done a lot of searching and all I can find are program that will do this in C and I can't really even get those to work right for me. Does anyone have a suggestion?
Any suggestions would be appreciated.
B.
|
|
|
|
|
Scrap the ListView and go with the DataGridView. It's designed to do exactly what you described.
|
|
|
|
|
Wrong tool
The listview is really not designed for inline editing or large datasets.
Use the datagridview.
|
|
|
|
|
Hi
Does anyone have any inclues of doing random numbers in one group and not one number in that group are to be the same.
Example ; 12,14,12,17,14 <-- not like that.
; 12,14,16,17,18 <--- like that.
Thanks
Joey
|
|
|
|
|
The way to do this, is to fill a List with your valid number values, then use a random generator to generate an index from which to pull a value out of that list. Once you pull it out, remove it from the list, so next time, your random generator generates an index into a list that only contains values that have not been picked.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yeh this is the best way to do it, i'd preserve the original numbers in one list, then create an identical list and use this for your selection process. You would be getting a number between 0 and the list's count - 1.
|
|
|
|
|
Hi
I was wondering how to get scores to a game I am doing and it has to telly-up. For example a Space game, for every hit I make on my target, the scores will add up. This has to done in VB.Net.
Thanks
Joe
Joey
|
|
|
|
|
The fact that you're asking this, makes me doubt you're able to write any game. I suggest buying a VB.NET book and working through it before starting your magnum opus.
In any programming language, values are stored in variables. Declare an integer variable, and when you hit your target, add the right number of points to that value.
Or, did I misunderstand the question ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
nope, you got it right.
Joey
|
|
|
|
|
On this stage what you'd like to do is to add timer control to your form, keep interval to whatever you like.. and put code in timer
if bullet.position = object.position then add point 'this is not actual code.
and as Christian said you need to learn atleast each controls of Visual Basic.
If you have any further question feel free to ask me.
Parth Patel
|
|
|
|
|
Hello,
I have a vista home premium system and I have installed VB 2005 on it. Installation went fine, No errors. But when I tried to create a project I got a popup "Strong Name Validation Failed for assembly Microsoft.VisualStudio. Please advise how to get around this issue. Thanks for your time and help in advance.
Jr. jith
-- modified at 19:46 Monday 24th September, 2007
|
|
|
|