Generally we use datarelation in dataset to create treeview with database<BR><BR>but i need multitable relationship<BR><BR>ex:-<BR><BR>master1 - mid,mname<BR><BR>tran - mid,tid,tname<BR><BR>addt - mid,tid,aid,aname<BR><BR>i want to relate master1 -&#062;tran -&#062;addt in tree structure<BR><BR>pls give example for using multiple datarelations<BR><BR>below codes are which i tryed here i can create treeview in this structure but i found data unique error<BR><BR>Imports System.Data<BR>Imports System.Data.SqlClient<BR>Imports mytest.connect<BR>Imports Microsoft.Web.UI.WebControls<BR>Imports Microsoft.Web.UI.WebControls.TreeNode<BR>Imports Microsoft.Web.UI.WebControls.TreeNodeCollection<BR >Imports Microsoft.Web.UI.WebControls.TreeView<BR>Public Class connect<BR> Inherits System.Web.UI.Page<BR><BR>#Region " Web Form Designer Generated Code "<BR><BR> &#039;This call is required by the Web Form Designer.<BR> &#060;System.Diagnostics.DebuggerStepThrough()&#06 2; Private Sub InitializeComponent()<BR><BR> End Sub<BR> Protected WithEvents Label1 As System.Web.UI.WebControls.Label<BR> Protected WithEvents Treeview1 As Microsoft.Web.UI.WebControls.TreeView<BR><BR> &#039;NOTE: The following placeholder declaration is required by the Web Form Designer.<BR> &#039;Do not delete or move it.<BR> Private designerPlaceholderDeclaration As System.Object<BR><BR> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init<BR> &#039;CODEGEN: This method call is required by the Web Form Designer<BR> &#039;Do not modify it using the code editor.<BR> InitializeComponent()<BR> End Sub<BR><BR>#End Region<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR> Dim conn As New System.Data.OleDb.OleDbConnection<BR> Dim com As New OleDb.OleDbCommand<BR> Dim da1 As New OleDb.OleDbDataAdapter(com)<BR> &#039; Dim da2 As New OleDb.OleDbDataAdapter(com)<BR> Dim ds1 As New DataSet<BR><BR> conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=E:chandrumytestdb2.mdb"<BR> com.Connection = conn<BR> Try<BR> conn.Open()<BR> com.CommandText = "select * from area_mst"<BR> da1.Fill(ds1, "area_mst")<BR><BR> com.CommandText = "select * from floor_mst"<BR> da1.Fill(ds1, "floor_mst")<BR><BR> com.CommandText = "select * from row_mst"<BR> da1.Fill(ds1, "row_mst")<BR><BR> ds1.Relations().Add("area_floor", ds1.Tables("area_mst").Columns("aid"), ds1.Tables("floor_mst").Columns("aid"))<BR> ds1.Relations().Add("floor_row", ds1.Tables("floor_mst").Columns("fid"), ds1.Tables("row_mst").Columns("fid"))<BR><BR> For Each masterrow As DataRow In ds1.Tables("area_mst").Rows<BR> Dim masterNode As New TreeNode<BR><BR> masterNode.Text = masterrow("area")<BR> masterNode.ID = masterrow("area")<BR><BR> Treeview1.Nodes.Add(masterNode)<BR><BR> For Each childrow1 As DataRow In masterrow.GetChildRows("area_floor")<BR> Dim childnode1 As New TreeNode<BR> childnode1.Text = childrow1("floor")<BR> childnode1.ID = childrow1("floor")<BR> masterNode.Nodes.Add(childnode1)<BR><BR> For Each childrow2 As DataRow In childrow1.GetChildRows("floor_row")<BR> Dim childnode2 As New TreeNode<BR> childnode2.Text = childrow2("row")<BR> childnode2.ID = childrow2("row")<BR> childnode1.Nodes.Add(childnode2)<BR> Next<BR> Next<BR><BR> Next<BR> Catch ex As Exception<BR> Label1.Visible = True<BR> Label1.Text = "Failed to connect to data source" & Err.Description<BR> Finally<BR> If (Not conn Is Nothing) Then<BR> conn.Close()<BR> End If<BR><BR> End Try<BR> End Sub<BR><BR>End Class<BR>