473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

BC30002 problem

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
2 1685
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: B R | last post by:
Hi, I am trying to use System.DirectoryServices for quering Active Directory, I am getting the following error Compiler Error Message: BC30002: Type 'DirectoryEntry' is not defined. Why I...
0
by: Jim Hansen | last post by:
I re-installed Framework and now I am getting this error ClassBrowser. Most other page work just fine. Additionally, the debugger will not start from Visual Studio 2003.. Compilation Error...
2
by: Ted | last post by:
I am new to ASP.NET and have been following te Quick Start tutorials (http://www.asp.net/tutorials/quickstart.aspx and...
1
by: JoeP | last post by:
Hi All, I have class named xRep.vb located at the App_Code folder. The below works just fine under the Visual Studio environment, but when running this code from the web server I am getting this...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.