Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type not defined

Status
Not open for further replies.

dpdg

Programmer
May 23, 2005
148
US
I've been getting this error in any page that I try to run and I shouldn't be. The funny thing is though, when I run it locally it doesn't give me this error. It's only when I upload it to the site and try to run it. This is ASP.NET 2.0. I never had this problem with ASP.NET 1.1 -- and I've used this same class before in other web apps without any problem.

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'OrderDetails' is not defined.

Source Error:



Line 31: End Sub
Line 32: Private Sub LoadGrid(ByVal iOrderID As Integer, ByVal iOrderID2 As Integer)
Line 33: Dim ds As New DataSet, ord As New OrderDetails
Line 34: ds = ord.GetOrderDetailsDataSet(iOrderID, iOrderID2)
Line 35: Session("GridOrderID") = iOrderID

 
I am guessing this is in VB.NET.

What I see in your like 33 is this

Line 33: Dim ds As New DataSet,
ord As New OrderDetails

Do you have a class file named ORDERDETAILS and the name of the class is spelt right here and the file is imported into this or the file here has access to the ORDERDETAILS class file?
 
OrderDetails is a class (yours right ?).

Things have changed a little bit, especially in ASP.NET 2.0 there are some special folders. In App_Bin you drop your compiled assemblied (dlls) and in App_Code you drop you classes (source files that are compiled by ASPNET).

Try copying the OrderDetails.vb (or whatever you named it) and the App_Code... so it can be located.

Hope that's it!
 
"I am guessing this is in VB.NET"

Yes. You can see it from the:
. structure (no '{' and '}' for code blocks)
. keywords "sub", "byval", "dim" ...
. no ';' that end a command
 
I've been having lots of problems with this ASP.NET 2.0 app. I've tried about everything that I can think of to get it to stop erring out. I did the 'rebuild web site' and 'publish web site' and that only served to make things worse. Now I'm getting this error:

The directory '/App_Code/' is not allowed because the application is precompiled.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The directory '/App_Code/' is not allowed because the application is precompiled.

What does this mean and what do I have to do to correct it?

Any help on this would certainly be appreciated.
 
ASPNETNewbie,

To answer your question, yes. The name is spelled correctly and is in the App_Code folder with the rest of the classes.

I'm still having trouble with this new ASP.NET 2.0 app. I'm getting the same error when I run it.

-----------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.


Compiler Error Message: BC30002: Type 'OrderDetails' is not defined.

Source Error:



Line 31: End Sub
Line 32: Private Sub LoadGrid(ByVal iOrderID As Integer, ByVal iOrderID2 As Integer)
Line 33: Dim ds As New DataSet, ord As New OrderDetails
Line 34: ds = ord.GetOrderDetailsDataSet(iOrderID, iOrderID2)
Line 35: Session("GridOrderID") = iOrderID

-----------------------------------------------

In fact, When I click on 'Show Detailed Comiler Output' it says that for every class I have defined:

-----------------------------------------------

Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

D:\Inetpub\TCHOLCIM.COM\ADMIN\associtems_grid.aspx.vb(26) : error BC30451: Name 'GetConnectionString' is not declared.

Private cs As String = GetConnectionString()
~~~~~~~~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\associtems_grid.aspx.vb(109) : error BC30451: Name 'DeleteRecord' is not declared.

Dim s As String = DeleteRecord(e.Item.Cells(0).Text, "AssocItems", "AssocItemsID")
~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\equip_grid.aspx.vb(31) : error BC30002: Type 'Grid' is not defined.

Dim grd As New Grid
~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\equip_grid.aspx.vb(32) : error BC30002: Type 'SubGroups' is not defined.

Dim sg As New SubGroups
~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\equip_grid.aspx.vb(39) : error BC30451: Name 'MessageBox' is not declared.

MessageBox.Show("Nothing to Delete!")
~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\equip_grid.aspx.vb(57) : error BC30002: Type 'SubGroups' is not defined.

Dim sg As New SubGroups
~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\orders_grid1.aspx.vb(33) : error BC30002: Type 'OrderDetails' is not defined.

Dim ds As New DataSet, ord As New OrderDetails
~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\orders_grid1.aspx.vb(60) : error BC30002: Type 'OrderDetails' is not defined.

Dim ord As New OrderDetails
~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\orders_grid1.aspx.vb(66) : error BC30002: Type 'OrderDetails' is not defined.

Dim ord As New OrderDetails, data As New OrderDetailsData
~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\orders_grid1.aspx.vb(66) : error BC30002: Type 'OrderDetailsData' is not defined.

Dim ord As New OrderDetails, data As New OrderDetailsData
~~~~~~~~~~~~~~~~
D:\Inetpub\TCHOLCIM.COM\ADMIN\rpc_admin.aspx.vb(49) : error BC30002: Type 'Orders' is not defined.

.
.
.
Etc.

---------------------------------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top