J
Jason Callas
I have a simple class written in vb.net:
'SongsDb.vb
Imports System.Configuration
Imports System.Data
Imports Microsoft.Data.Odbc
Namespace AquehongaPortal
Public Class SongsDb
Public Function GetSongs() As DataSet
Dim sql As String
' build sql statement
sql = "SELECT SongId,Title,Body,Type,PostedBy FROM Song WHERE ApprovedFlag = 1"
' create instance of Connection and DataAdapter object
Dim dbConn As New OdbcConnection(ConfigurationSettings.AppSettings("ConnectString"))
Dim dbDA As New OdbcDataAdapter(sql, dbConn)
' create and fill the DataSet
Dim dbDS As New DataSet()
dbDA.Fill(dbDS)
' give it back
Return dbDS
End Function
End Class
End Namespace
And a simple test web page:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="AquehongaPortal" %>
<script runAt="Server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim songs As AquehongaPortal.SongsDb = New AquehongaPortal.SongsDb()
End Sub
</script>
<html>
<head>
<title>Test Page</title>
</head>
<body>
Test
</body>
</html>
The vb file was compiled and copied to the /bin folder of the default application.
As far as I know that is all I am supposed to do, yet I still get the error BC30002: Type 'AquehongaPortal.SongsDb' is not defined.
Any thoughts?
Thanks.
'SongsDb.vb
Imports System.Configuration
Imports System.Data
Imports Microsoft.Data.Odbc
Namespace AquehongaPortal
Public Class SongsDb
Public Function GetSongs() As DataSet
Dim sql As String
' build sql statement
sql = "SELECT SongId,Title,Body,Type,PostedBy FROM Song WHERE ApprovedFlag = 1"
' create instance of Connection and DataAdapter object
Dim dbConn As New OdbcConnection(ConfigurationSettings.AppSettings("ConnectString"))
Dim dbDA As New OdbcDataAdapter(sql, dbConn)
' create and fill the DataSet
Dim dbDS As New DataSet()
dbDA.Fill(dbDS)
' give it back
Return dbDS
End Function
End Class
End Namespace
And a simple test web page:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="AquehongaPortal" %>
<script runAt="Server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim songs As AquehongaPortal.SongsDb = New AquehongaPortal.SongsDb()
End Sub
</script>
<html>
<head>
<title>Test Page</title>
</head>
<body>
Test
</body>
</html>
The vb file was compiled and copied to the /bin folder of the default application.
As far as I know that is all I am supposed to do, yet I still get the error BC30002: Type 'AquehongaPortal.SongsDb' is not defined.
Any thoughts?
Thanks.