Print Page | Close Window

Typo With DataList

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=16496
Printed Date: 28 March 2026 at 5:58pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Typo With DataList
Posted By: Misty
Subject: Typo With DataList
Date Posted: 09 September 2005 at 3:57pm

Can someone please help me? It is obvious that I have a typo somewhere in my data list.

I'm getting the following error message: Compiler Error Message: BC30002: Type 'DataSet' is not defined.

Source Error:

Line 149:                 Dim strSQL as String                 
Line 150:                 Dim dtaTestimonials as New System.Data.SqlClient.SQLDataAdapter()   
Line 151:                 Dim dtsTestimonials As New DataSet() 


  '---------------------------------------------
        ' name: BindDataList()
        '---------------------------------------------
        Sub BindDataList()
       
                 Dim strConnect As String
                 Dim objConnect As New System.Data.SqlClient.SQLConnection
                 Dim objCommand As New System.Data.SqlClient.SQLCommand
                 Dim strSQL as String               &nbs p;
                 Dim dtaTestimonials as New System.Data.SqlClient.SQLDataAdapter()  
                 Dim dtsTestimonials As New DataSet()

                'Get connection string from Web.Config
                strConnect = ConfigurationSettings.AppSettings("ConnectionString")

                objConnect = New System.Data.SqlClient.SQLConnection(strConnect)
               
                objConnect.Open()
       
        'Build SQL string
        strSQL = "Select * From VisitorTestimonial where Approve = 0 Order by DateSigned desc" 

 

                 'Set the Command Object properties
                 objCommand.Connection = objConnect
                 objCommand.CommandType = CommandType.Text
                 objCommand.CommandText = strSQL

                 'Create a new DataAdapter object
                 dtaTestimonials.SelectCommand = objCommand

                 'Get the data from the database and
                 'put it into a DataTable object named dttTestimonials in the DataSet object
                 dtaTestimonials.Fill(dtsTestimonials, "dttTestimonials")

                 'Set the DataSource property of the DataList
                 dtlTestimonials.DataSource = dtsTestimonials
                
                 'Bind all the controls on the page
                 dtlTestimonials.DataBind()

        End Sub 




Replies:
Posted By: Mart
Date Posted: 09 September 2005 at 4:24pm
Dim dtsTestimonials As New System.Data.DataSet() 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net