Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1825
Add node/columns per code
posted

Dear all!

I am trying to code a 2-level UltraTree, but the Control is always empty.

Please Review my code, maybe I am missing something:

SQLstr = " SELECT DISTINCT vs_IMS_Companies.ShortText, vs_IMS_Companies.CompanyID - 100 as CompanyID"

SQLstr += " FROM t_M_Employee INNER JOIN"

SQLstr += " vs_IMS_Companies ON t_M_Employee.CurrentIMSCompany = vs_IMS_Companies.CompanyID"

DS = IMS_Core_Class.mdl_DataHandling.MakeDataset(SQLstr, "A1", IMS_ED_Class.m_DataHandling.ConnString_Master)

SQLreader = DS.CreateDataReader

Do While SQLreader.Read

Me.UltraTree1.Nodes.Add(SQLreader("CompanyID"), SQLreader("ShortText"))

Loop

SQLreader.Close()

DS = New DataSet("A2")

SQLstr = " SELECT t_M_Employee.EmployeeID, t_M_Employee.LastName + ' ' + t_M_Employee.FirstName AS EmployeeName, vs_IMS_Companies.CompanyID -100 as CompanyID"

SQLstr += " FROM t_M_Employee INNER JOIN"

SQLstr += " vs_IMS_Companies ON t_M_Employee.CurrentIMSCompany = vs_IMS_Companies.CompanyID"

DS = IMS_Core_Class.mdl_DataHandling.MakeDataset(SQLstr, "A2", IMS_ED_Class.m_DataHandling.ConnString_Master)

SQLreader = DS.CreateDataReader

Do While SQLreader.Read

ParentNode = Me.UltraTree1.Nodes(SQLreader("CompanyID").ToString)

ParentNode.Nodes.Add(SQLreader("EmployeeID"), SQLreader("EmployeeName"))

Loop

SQLreader.Close()

Doing a quickwatch I see that all nodes are correctly added, but the control Show nothing.

Any idea?

Parents Reply Children
No Data