Hi there... Assuming the selected node stores the primary key of the value in its tag property, you could use that to update the db: Dim Key=TreeView1.SelectedNode.Tag Dim Val=TextBox1.Text Dim TA as new MyTableAdapter TA.Update(Key,Val) this code is just for illustration so that you could get the idea. It need modification based on your work/problem.
@gstringavenger12 жыл бұрын
Very good. I was searching all over for a tutorial like this. thanks.
@bsworldsolution66264 жыл бұрын
well detail tutorial, please how can i populate the treeview to textbox from a different table
@mkaatr12 жыл бұрын
Hi there... I made many tutorials previously regarding this. What you are asking is simply combining multiple ideas which is not too hard. Try to check the database tutorials in the website, also check out the question & answer, and the how to sections there.
@mkaatr13 жыл бұрын
Hi... Not sure if I got your question right, do you mean that you want to update the db and then the tree should be updated? If so you could simply reload the tree from db. Does that answer your question or did I misunderstood you?
@bigbirdpukindog10 жыл бұрын
How would you handle "open DataReader associated with this Connection which must be closed first" error with mysql? Mysql doesn't support MultipleActiveResultSets=True
@i7arithran12 жыл бұрын
Yes mate that's exactly what i want. But how can you update the database from a string variable ?
@sumair4u13 жыл бұрын
Dear Mkaatr,, i tried it with my SQLSERVER Database, but it gave me the following error: "There is already an open DataReader associated with this Command which must be closed first." After that I Surrounded the Filltree by Catch Try, it didnot gave the error mention above, but not working propely, i mean it showing only Parent items, not child,, plz tell me whats the problem Thank you
@liakutalikhan61907 жыл бұрын
Showing An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll what to do
@DupczacyBawol9 жыл бұрын
Works a lillte slow when you got 200 nodes with 4-5 subnodes inside... about 1000 queries to DB? But very useful tutorial. Thank you :)
@mkaatr9 жыл бұрын
Readme .txt Just try SuspendLayout before filling the treeview, then ResumeLayout after that. This should make things a little bit faster. Also you could create an index on the node_parent column. This should speed things up.
@mkaatr13 жыл бұрын
@sumair4u Hi there... Sorry for the late response. In SQL Server, each time you open a DataReader, you can't open another one unless you close the previous first. To solve this, add the following to the end of the connection string: MultipleActiveResultSets=True yours sincerely.
@i7arithran13 жыл бұрын
Hey man, Great Tutorial Can you post a method for updating the database ; The value from a textbox to a selected node as a child.or something similar. Cheers mate!
@adiyehan12 жыл бұрын
i got an error in the line "Dim dr = cmd.ExecuteReader" Data type mismatch in criteria expression. please help
@teyenk1312 жыл бұрын
oooh i use mysql, i use MySql.Data.MySqlClient.MySqlDataReader to dr... but i got error in the recursive function.. can you help me?
@dealerlinksystems9 жыл бұрын
It's a GREAT way to do it, just what I was looking for... Can you please assist with one more thing thou. Im setting up a treeview to select, then open each PDF (I use process.start to open the PDF which works fine) but how can I setup the link from the "selected treeview node, to open the selected pdf" (the pdf list is hard coded, so no DB is used) I'm just outside Toronto, Canada... Your kind assistance would be key to my project, Thank you in advance, Drew (SYKPE ID "drew.wells2")
@Felixantony8412 жыл бұрын
nice tutorial. thank you verymuch sir.........
@mkaatr13 жыл бұрын
@mellwell2005 You are welcome.
@mkaatr14 жыл бұрын
@waroftheworldseu Sorry about that, I updated the title as suggested. yours.
@1972pms9 жыл бұрын
very useful tutorial
@sauryjorge8 жыл бұрын
Gracias me resuelto útil para lo que quería, gracias!
@bopert13 жыл бұрын
thank you sir!
@mkaatr14 жыл бұрын
@aalamnaryab Hi there... search the website for : "Re: alamnaryab - view hard disk dir in treeview" or just search the questions and answers section. I uploaded a video for that. yours