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