By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

BC30002 problem

P: n/a
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.
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JD
Is the songsdb.vb getting compiled to the same assembly as the web page?

"Jason Callas" <Ja*******@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP11.phx.gbl...
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.
Nov 18 '05 #2

P: n/a
Thanks for applying but I figured it out.

Because I created the vb file in VS.NET it decided to add its own namespace (named SongsDb) to the project.

Soooo.... With my own namespace statement the full namespace became SongsDb.AquehongaPortal.SongsDb.

All cleaned up and working.

(To answer your question JD --- no. The vb file was compiled completely separately. Would not even be sure HOW to get a web
page to be included as part of an assembly)

- Jason
"JD" <No@Where.com> wrote in message news:uR**************@tk2msftngp13.phx.gbl...
Is the songsdb.vb getting compiled to the same assembly as the web page?

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.