1 <%@ Page Language="vb" %>
\r
2 <%@ Register TagPrefix="Rico" Assembly="Rico" NameSpace="Rico" %>
\r
3 <%@ Register TagPrefix="My" TagName="dbLib" Src="dbConnect.ascx" %>
\r
4 <My:dbLib id='app' runat='server' />
\r
6 <script runat="server">
\r
8 Sub Page_Load(Sender As object, e As EventArgs)
\r
9 Dim parent as String = Left(Request.QueryString("Parent"),1) ' first character of company name
\r
11 if not app.OpenDB() then
\r
12 TreeData.ErrorMsg=app.LastErrorMsg
\r
14 TreeData.dbConnection=app.dbConnection
\r
15 if parent <> "" then
\r
16 ' get the leaf nodes - customer names starting with the letter contained in parent
\r
17 TreeData.sqlText="SELECT '" & parent & "',CustomerID,CompanyName,'L',1 FROM customers where CompanyName like '" & parent & "%'"
\r
19 ' this is a request for the root node
\r
20 TreeData.WriteTreeRow("","root","Customer names starting with...","C",0)
\r
21 ' return a list of the first letters of the company names
\r
22 TreeData.sqlText="SELECT distinct 'root',left(CompanyName,1),left(CompanyName,1),'C',0 FROM customers"
\r
29 <Rico:TreeResponse id="TreeData" runat="server"/>
\r