473,320 Members | 1,865 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,320 software developers and data experts.

inherits

Hi all,

I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

any help apprecaited

thanks

Portroe

Nov 20 '05 #1
5 1198
Some possible causes:
1) Are the 2 classes in the same namespace?
2) Are there any syntax errors in the Person class?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"portroe" <bo*@sleigh.com> schreef in bericht
news:uB**************@tk2msftngp13.phx.gbl...
Hi all,

I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

any help apprecaited

thanks

Portroe

Nov 20 '05 #2
Hi,

The definition for Student doesn't come before the End Class of Person does
it?

I've done this before, accidentially defining one class inside another. It
caused
a fair bit of confusion till I spotted it because it auto-syntaxed it, found
in the
object viewer etc...

Regards,
Peter
"portroe" <bo*@sleigh.com> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
Hi all,

I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

any help apprecaited

thanks

Portroe

Nov 20 '05 #3
"portroe" <bo*@sleigh.com> schrieb
I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is
not defined,


Which namespaces are the classes part of?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Okay found it,

it was not in the solution explorer,

so I just added new and pasted code again,

I have no idea how I did this,

thanks

Portroe

Peter Row wrote:
Hi,

The definition for Student doesn't come before the End Class of Person does
it?

I've done this before, accidentially defining one class inside another. It
caused
a fair bit of confusion till I spotted it because it auto-syntaxed it, found
in the
object viewer etc...

Regards,
Peter
"portroe" <bo*@sleigh.com> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
Hi all,

I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,

any help apprecaited

thanks

Portroe



Nov 20 '05 #5
* portroe <bo*@sleigh.com> scripsit:
I have built a base class person.vb, which is defined

Public MustInherit Class Person

My second class is called student.vb, which has as its first line

Public Class Student
Inherits Person

I however receive an error in the code here saying, type person is not
defined,

I have obviously overlooked something,


1. Are the classes in the same project? If not, set a reference.
2. Are the classes in the same namespace and/or are namespaces
imported? If not, then add them to the same namespace or import the
namespace of the base class.
3. If nothing works, type the 'Person' in the definition of the base
class again (that's a bug which sometimes occurs, don't know why).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: shine | last post by:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="shine.WebForm1" %> what does Inherits means in this tag, what is the use of it plz explain me regards...
4
by: Ben R. | last post by:
Between ClassName and Inherits, which attribute is set to specify the class that a page uses? I would think that would be inherits. Further, the description for ClassName is: Specifies the class...
0
by: Rob Meade | last post by:
Hi all, ok - the scenario... We have a secure login page known as the Clinical Portal (single login etc) - we have a web user control for this which checks if a session is available or not...
6
by: Todd A | last post by:
If I use the following in my code behind page: Public Class _Default Inherits System.Web.UI.Page The page will compile with no errors from the command line compiler (vbc.exe) But, If I...
0
by: Alex Nitulescu | last post by:
Hi, I have the following in project "RaducuCustomControls": Imports System.ComponentModel Imports System.Web.UI <DefaultProperty("Text"), ToolboxData("<{0}:Rotator1...
1
by: Roberto Bindini | last post by:
Hi with visual studio 2005 beta 2 i have created two form: frm1 (Inherits System.Web.UI.Page) frm2 (Inherits frm1) but in the line code : Inherits frm1 vs send error: type frm1 is not defined
10
by: Tony Abate | last post by:
I am working on an ASP.NET app that is going well except for one thing. I build my application and then move the .aspx file to a different directory. I can point the Codebehind property back to the...
2
by: Don | last post by:
1. Say I have three classes: A, B and C. 2. Class A can only be inherited, and B inherits it. C does not inherit anything. 3. I have a function that can have an object passed to it. Either B...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
1
by: Arpan | last post by:
What's the difference between "Imports" & "Inherits"? For e.g. both the codes below work without any errors: Imports System Imports System.Data Imports System.Web.UI Namespace Constructors...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.