|
Hi,
I've been banging my head on the keyboard for a few days now searching for a solution to my problem. Iv'e searched Google for a solution but I can't seem to find any.
The node information is stored in a MySQL database using the nodes.fullpath command or like this:
lvl1\lvl2\lvl3
Now, I've seen and tried to use the treeview.nodes.add(1).nodes.add(2).nodes.add(3) with a split command but because I don't know how many levels there are before hand this makes a giant select case that makes me cry each time I see it.
I want the routine to check if the level exists then add it if it doesn't and/or move to the next level. (Geez it sounds so simple writen like that...)
Here is the routine I'm using
Dim SQL As String = "Select * from troubleshooting order by node_path asc"<br />
Dim StrNodePath As String<br />
Dim nNode As TreeNode<br />
Dim BolNew As Boolean = True<br />
Dim X As Integer<br />
Dim StrNode As String<br />
<br />
<br />
RSProbleme = ReturnForm.StrConn.Execute(SQL)<br />
<br />
Do Until RSProbleme.EOF = True<br />
<br />
StrNodePath = RSProbleme("node_path").Value<br />
aNodePath = Split(StrNodePath, "\")<br />
<br />
For X = 0 To UBound(aNodePath)<br />
BolNew = True<br />
For Each nNode In TrVProbleme.Nodes<br />
<br />
If nNode.Text = aNodePath(X) Then<br />
BolNew = False<br />
End If<br />
<br />
Next<br />
If BolNew = True Then<br />
nNode.Nodes.Add(aNodePath(X)) <-- This is the line that gives me trouble<br />
End If<br />
Next<br />
<br />
RSProbleme.MoveNext()<br />
Loop
When adding it gives me the error, "Object reference not set to an instance of an object." and using the variable watch in VS it says that nNode = Nothing.
Any help will be greatly appreciated. (My head hurts from all that banging...)
Thanks
For every action there is an equal and opposite malfunction
|
|
|
|
|
I am guessing that you created a treeview called TrVProbleme in your application. If you have not added any nodes to the treeview - then nNode will be nothing. You might want to try changeing the statement nNode.Nodes.Add(aNodePath(X)) to TrVProbleme.Nodes.Add(aNodePath(X))
Hope this helps
Digicd1
|
|
|
|
|
Indeed you are correct; while I did not change the line as you suggested I've added a If... End If checking if this was a root node or not then added your line.
(Can't believe it was so simple grr...)
Thanks a bunch!
Raist
For every action there is an equal and opposite malfunction
-- modified at 12:12 Wednesday 10th May, 2006
|
|
|
|
|
hi!
have u finish adding nodes to a treeview control?
can u help me!
can u give me ur code and the code in SQL!
i need it badly!
i hope u can help me!
thanks a lot!
coder
|
|
|
|
|
What kind of code are you interested in and what is the purpose?(what is it supposed to do?)
Raist
For every action there is an equal and opposite malfunction
|
|
|
|
|
good morning! a code that will retrieve the data from database or using query!
i will use the treeview for making a organizational chart!
one main ParentNode(Division),childnode(Department) and subchildnode(Section)
Thanks for ur kindheart!
"Giving something does not reduce what you have but gain more!"
coder
|
|
|
|
|
Good morning!The code that i will use is all that name in the node that wiil display is came from the database,
or using query!
i will use it in making organizational chart!
the content is i have a parentnode(Division), Chilnode(Department) and SubChildnode(Section).
thanks!
" Giving something to anyone is not reducing what u have instead you gain more!"
coder
|
|
|
|
|
Hi!
The following code selects a row from a table. If the row exists then it is updated otherwise a new row is added to the table.
How can I write this code using ADO.NET 2.0?
Dim rsRequest As New ADODB.Recordset<br />
rsRequest.Open "Select Form_No, User_ID, Status, Request_Date from tbl_ReExport_Info Where Form_No = '" & txtFormNo.Text & "' And User_ID = '" & txtUserID.Text & "'", cnnADO, adOpenDynamic, adLockOptimistic<br />
With rsRequest<br />
If .EOF = True Then .AddNew<br />
!Form_No = txtFormNo.Text<br />
!User_ID = txtUserID.Text<br />
!Status = 0<br />
!Request_Date = Now<br />
.Update<br />
End With<br />
Thank You
Gulfraz Khan
|
|
|
|
|
Can anyone tell me a way, or give me a class, that will allow me to handle Complex numbers, i.e. square roots of negative numbers. If it's important, I am using the Visual Basic 2005 Express Edition. Also, if relevant, I am trying to program the general solution to a cubic polynomial. I only started learning VB four days ago and have, as such, limited experience, so any help is hugely appreciated.
|
|
|
|
|
Hopefully this article here can give you a head start (It is in C# though)
http://msdn2.microsoft.com/en-us/library/6fbs5e2h.aspx
|
|
|
|
|
Thanks for the link, really appreciate the help. Only problem is that, as I started programming last Saturday, I don't really have the know how to translate what's there to VB. If anyone has any VB links, particularly ones that are designed to explain how to program a class or function in the first place, I would be eternally grateful.
|
|
|
|
|
I run my vb.net windows application that has crystal report in a pc it runs perfectly well and i am able to see the reports , but when i take setup of the application and run in same pc i get error "load report failed".
I have added the following to setup project
atl.msm
Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm
CrystalReports10_NET_EmbeddedReporting.msm
VC_User_ATL71_RTL_X86_---.msm
VC_User_CRT71_RTL_X86_---.msm
VC_User_STL71_RTL_X86_---.msm
apphelp.dll
msado25.tlb
I have added the following references
CrystalDecisions.CrystalReports.Engine
CrystalDecisions.ReportAppServer.ClientDoc
CrystalDecisions.ReportSource
CrystalDecisions.Shared
i am also adding
the reports ,
source files from "Project Name" and
primary output from "Project Name"
I don't understand what could be the problem as i am using the same pc.
If any of you know the solution do tell me.
Thanks in advance,
sarah
-- modified at 11:06 Tuesday 9th May, 2006
|
|
|
|
|
Don't really know that much about Crystal, but I've seen this problem a lot. Usually affects older operating systems (Win 98/ME/NT) in my experience, and is down to a missing DBGHELP.DLL file.
Visit:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=CD1FC4B2-0885-47F4-AF45-7FD5E14DB6C0
to see if this helps.
|
|
|
|
|
hi,
can anybody help me how to export crystal report from vb in pdf format.
plz help me.
|
|
|
|
|
are you using WindowsApp or WebApp??
|
|
|
|
|
i am using windowsapp
means their are 3-4 formats in which i am able to send the report but in pdf it's not.
|
|
|
|
|
I am having problems with pseudocode and flow chart. Also very confusing is the DSD DIAGRAMS.with UML diagrams i also need som help
Eleazer Okoto
|
|
|
|
|
|
hi all,
actually i dont know much about VB.Net and i use some converstion techniques to convert C# codes into VB ...
i have the lines below :
...
Dim PD As PrintDocument = New PrintDocument
PD.PrintPage += New PrintPageEventHandler(PrintDocument1_PrintPage)
Dim pdiyalog As PrintDialog = New PrintDialog
...
i get these two errors because of the lines above :
Error 1 'Public Event PrintPage(sender As Object, e As System.Drawing.Printing.PrintPageEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Error 2 'System.Drawing.Printing.PrintPageEventHandler' is a delegate type and requires a single 'addressof' expression as the only argument to the constructor.
how can i modify the VB.NET codes above so as not to get errors above ?
help please ...
|
|
|
|
|
|
I have a function which check for the folder size.
When i run this function through a window application it runs fine for a network folder.
Butr when i run it from a window service then it gives me "Access Denied" error on the same folder as i used in window app.
Any clu why is this happening?
|
|
|
|
|
web service uses ASP.Net user. So your ASP.Net user must have admin rights on the system.
Regards
Rizwan Bashir
|
|
|
|
|
This is the Q.
What diff it makes for executing the same code from a win app and from a win service.
even if it does how do i make sure that win service has sufficient privilidges ( one way is when insatalling through admin account)
|
|
|
|
|
I am sorry in one go I read this as Web Service instead of window service. well for window service there is no difference. until unless you mentioned the user name in the service who will run it. Like go to services in control panel and then right click on any service and see properties then on second tab you can see the log on information. and check who has the previlage to work on the service. this is some thing which you can configure while building the setup . so define admin user and it will never create any problem.
Ans for your question :
Executing same code is run under the previlage of logged on User. and service will run under the defined user in the services as explained above.
Regards
Rizwan Bashir
|
|
|
|
|
Hello, can any one tell me the ways to access the common dialog conrol in application?.. it shows error while using the common dialog conrol. Is it means that the error occurs while installing the .NET pack? or else what i have to do for rectifying the error.
Thanks
with regards,
K.Vijaya
|
|
|
|