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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiler Error Message: BC30002 Type not defined

Status
Not open for further replies.

dpdg

Programmer
May 23, 2005
148
US
Greetings All!

I just uploaded my page that runs perfect on my development machine, but I get this error when I try to run it.
Could someone please tell me what I'm doing wrong and how to fix it?

I appreciate all your help very much. You've all saved me lots of time in the past!

Server Error in '/' Application.
--------------------------------------------------------------------------------
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 'mywebsite.Common' is not defined.

Source Error:



Line 5: Inherits System.Web.UI.Page
Line 6:
Line 7: Private com As New mywebsite.Common
Line 8: Private cs As String = com.GetConnectionString()
Line 9: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


Source File: D:\Inetpub\mywebsite.com\users.aspx.vb Line: 7


=======================================================

Here's the code:
Code:
Imports System.Data.SqlClient
Imports mywebsite.Common

Partial Class users
   Inherits System.Web.UI.Page

   Private com As New mywebsite.Common
   Private cs As String = com.GetConnectionString()
   

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      If Not Page.IsPostBack Then
         LoadGridView()
      End If 

   End Sub


Here's where it's defined:
Code:
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Namespace mywebsite


   Public Class Common
      Public Function GetConnectionString() As String
         Dim cs As String = "etc;etc.,etc.,etc.,etc.,etc.,"
         Return cs
      End Function
   End Class

End Namespace


Thanks again!
 
looks like mywebsite.Common is only partial...you need to use the complete namespace. It should be something like xxxx.mywebsite.Common. check to see what xxxx is in your case.

-DNG
 
There's nothing that comes before that. Even if there were how would I know what it would be?
 
Imports mywebsite.Common

needs to be only

Imports mywebsite

Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top