PDA

View Full Version : Treeview component problems


bsinb03
01-23-2005, 10:11 AM
[quote]I am trying to get a treeview page to work but I am getting an error. I have no problems on my test machine.
[quote]
[quote]Compiler Error Message: BC30560: 'Tree' is ambiguous in the namespace 'obout_ASPTreeView_Pro_NET'.

Source Error:







Line 8: Dim html As String
Line 9: ' Classic style
Line 10: Dim oTree As New obout_ASPTreeView_Pro_NET.Tree()
Line 11:
Line 12: html = "Frequently Asked Question Articles"

[quote]The entire control is below, it uses SQL to populate the menu.
[quote]

<%@ Control Language="vb" %>
<%@ OutputCache Duration="3600" VaryByParam="None" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Assembly Name="obout_ASPTreeView_Pro_NET, Version=1.0.1.0, Culture=Neutral, PublicKeyToken=2ad7d5479323b9bf" %>
<script language="VB" runat="server">
Sub Page_Load()
Dim html As String
' Classic style
Dim oTree As New obout_ASPTreeView_Pro_NET.Tree()
html = "Frequently Asked Question Articles"
oTree.Add("", "root", html, True, "xpNetPlace.gif")
Dim poRec, psSQL, psParentID, psNodeID, psHTML, pbExpand, psImage
Dim dbRead as OleDbDataReader
Dim sConnectionString As String
Dim PathInfo as string
PathInfo = System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_smSQL")
Dim con as OleDbConnection = new OleDbConnection(PathInfo)
Dim da as OleDbCommand = new OleDBCommand("sm_allFaqArticles",Con)
da.CommandType = CommandType.StoredProcedure
con.open
dbRead = da.ExecuteReader()
Do While dbRead.Read()
psNodeID = "A" &amp; dbRead("articleID")
psParentID = "A" &amp; dbRead("articleParent")
psHTML = "<a href='Article/" &amp; dbRead("articleID") &amp; ".aspx'>" &amp; dbRead("articleTitle") &amp; "</a>"
pbExpand = dbRead("articleDefault")
psImage = "page.gif"
If psParentID = "A0" Then
psParentID = "root"
End If
oTree.Add(psParentID, psNodeID, psHTML, pbExpand, psImage)
Loop
lblTreeView.Text = oTree.HTML()
oTree = Nothing
dbRead.close
Con.close
End Sub
</script>
<!-- Begin Faq.ascx / Cached 60 minutes -->
<table class="tblGradientBlue">
<tr>
<td>
<p class="titleText1">Frequently Asked Questions</p></td>
</tr>
</table>
<p>You can browse the articles below.</p>
<ASP:Label id="lblTreeView" runat="server" />
<!-- End Faq.ascx --></CODE>

Post Edited (bsinb03) : 1/23/2005 10:58:45 PM GMT

Aristotle
01-24-2005, 10:23 AM
Make sure that you don't have the dll in your application's bin. The one on the server should already be preloaded in the machine.config.

bsinb03
01-25-2005, 01:00 AM
Thanks, removed the dll and it worked a treat.