Grrr...Just
got redirected off this page and have to run to my other job, so
everything I typed got wiped out. But basically, if anyone sees an
error in this I'd appreciate your help, for some reason its finding
Collection() as undefined.
Code:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.OleDb
Public Class DataList
Inherits Page
Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim colFruit As New Collection()
colFruit.Add("Kiwi")
colFruit.Add("Pear")
colFruit.Add("Mango")
colFruit.Add("Blueberry")
colFruit.Add("Apricot")
colFruit.Add("Banana")
colFruit.Add("Peach")
colFruit.Add("Plum")
lstItems.DataSource=colFruit
Me.DataBind()
' Could use lstItems.DataBind() to bind just the list box.
End Sub
End Class
Error:
Compiler Error Message: BC30002: Type 'Collection' is not defined.
Source Error:
|
Line 11: Line 12: Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load Line 13: Dim colFruit As New Collection() Line 14: colFruit.Add("Kiwi") Line 15: colFruit.Add("Pear") |