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

NullReferenceException with MyBase.New()

I have an object employee that is derived from person object. In .net 1.1 the
following procedure worked without any problem. In 2.0 i get the
nullreferenceexceptionerror. What could be going on here?

public class employee
inherits person

public sub new(info as string)
mybase.new(info) <<<<<<<<<<<<nullreferenceexception was unhandled by user
code (object reference not set to an instance of an object)
end sub

thx
dave
Dec 21 '05 #1
3 1389
I don't believe there's anything wrong with your syntax.

Clearly there's simply a nullreference exception in your base constructor.

perhaps info is null? it's impossible to tell what else the problem could
be without knowing what the New(info as string) constructor of Person is.

--
MY ASP.Net tutorials
http://www.openmymind.net/
"dave" <da**@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
I have an object employee that is derived from person object. In .net 1.1
the
following procedure worked without any problem. In 2.0 i get the
nullreferenceexceptionerror. What could be going on here?

public class employee
inherits person

public sub new(info as string)
mybase.new(info) <<<<<<<<<<<<nullreferenceexception was unhandled by user
code (object reference not set to an instance of an object)
end sub

thx
dave

Dec 21 '05 #2
Thank you Karl for your fast feedback.

Yes, you were right the base class (dll) had errors in it.

ty
Dec 22 '05 #3
Dave

Checkout base constructor and argument that you pass to clild
constructor (info).

B

Dec 22 '05 #4

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

Similar topics

0
by: Eric Diana | last post by:
I am trying to place an strings into an array of strings I am declaring as Dim Fields() As String I have another variable im doing the same thing with and it works. Public Shared Operations()...
1
by: gregory_may | last post by:
This code seems to "work" but I get the following errors: An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll then this one: An unhandled...
0
by: monkey king | last post by:
I have a given dll file(PDFCreator.dll) - probably generated by VC++. I want to use its method(PDFCreator()) in dotNet environment. It works well in WindiowsApplication, but bad in WebApplication...
2
by: Shannon | last post by:
I am having a very strange issue with my asp.net application. I have created a datagrid which dynamically gets populated from a person choosing a value from a dropdown list and entering a quantity...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
3
by: Patrick.O.Ige | last post by:
I'm loading an Array below but getting the error "Object reference not set to an instance saying 'ItemNumber = CType(Args.Item.FindControl("ItemNumber"), TextBox).Text' is the error line. I DON'T...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
10
by: Ivan Weiss | last post by:
Hey all, I am using the following code to attempt to draw an image on the MdiClient Area thanks to some help from another post. However, the line If m_MDIClient.Width > 0 And m_MDIClient.Height >...
5
by: Martin H. | last post by:
Hi, I've got this problem: I currently work on a control which inherits from ListBox. In my control I shadowed the Items with a custom ObjectCollection, which has some additional properties....
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.