c# - How to bind a dataset with multiple tables to asp.net treeview control? -


I have a tree view control in which I have to pair the dataset with more than one data table, and there is a connection between them. .

Can you recommend how I can do this, I have tried many ways but none of them proved to be useful ...

Thanks

Try this code, hope will be useful..I just copied the pasted code ... you Columns can be changed.

Datatable DT = New DataTable (); DataTable DT1 = New DataTable (); Dataset ds = new dataset (); Ds.Tables.Add (DT); Ds.Tables.Add (DT1); Ds.Relations.Add ("children", dt.Column ["GSICCodeID"], dt1.Column ["GSICCodeID"]); If (DSTibles [0] .Rows.Count> 0) {tvSicCode.Nodes.Clear (); Int32 i = 0; Foreach (Datarov MasterRo in Dtsibles [0] .Rao) {Trinod Masternode = New Triode (String) MasterR ["Details"], Convert. Toaster (master road ["gsiccode id"])); TvSicCode.Nodes.Add (masterNode); ("Baby") (tier node hair node = new triode (string) hair cry ["SIC codedesk"], convert.Toastring (hair RO ["SICcodID"])); If (convert to tostring (ds.Tables [1] .rove [i] ["career siccode"]) = "" childNode.Checked = true; masterNode.ChildNodes.Add (childNode); i ++;}} TvSicCode .CollapseAll ();}

Comments