Compiler Error Message:BC30002: Type 'MyClass' is not defined.
I get The following Error Message: BC30002: Type 'MyClass' is not defined. Basically vb.net doesn't recognize my Class that i have made. i try to make the project as simple as possible to see if i can get around this problem but unfortunately i can't.
My project is made up of two simple files a web page called' DEFAULT.ASPX' and a custom class called 'MyClass.vb'.
The aspx web page is made up of two components a grid and a button as shown underneath:
<asp:Button ID="Button1" runat="server" Text="Button"/>
<asp:DataGrid ID="Datagrid1" runat="server">
The code behind of the default.aspx page has the following syntax:
Partial Class _Default
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myDAL As MyClass= New MyClass
Datagrid1.DataSource = myDAL.GetAllCustomersDAL
the MyClass.vb file is located in the App_Data folder and has the following syntax:
Public Class MyClass
Public DataBaseLocation As String = "C:\northwind.mdb"
Public ConnString As String = "Provider=Microsoft.jet.ol
ta Source=" + DataBaseLocation + ""
Public Function GetAllCustomersDAL() As DataSet
Dim Dataset1 As DataSet = New DataSet
Dim SQLCommand As String
Dim MyConnection As OleDbConnection = New OleDbConnection
ing = ConnString
SQLCommand = "SELECT * FROM customers"
Dim dataAdapter1 As OleDbDataAdapter = New OleDbDataAdapter(SQLComman
I also opened the VS 2005 command prompt and navigated to the appropriate folder and entered the following command:
asic.dll /t:library /out:MyClass.dll MyClass.vb
This creates the MyClass.dll in the same directory where the MyClass.vb is located (App_Code).
After this step i add reference to the file by going to Add References, this adds the 'MyClass.dll' file to the 'BIN' directory of the project. I would like to point out that the web application runs fine when i am in the VB.NET environment i.e (http://localhost:1563//myProject/default.aspx
) but I get the ERROR when i run the web application off the web server on my computer i.e (http://www.wiredbrain123.com/default.aspx
). Any help is appreciated, i am very desperate since i have tried everything i know and i have had this problem for the past month now with no solution.
thanks in advance,