|
-
Aug 23rd, 2006, 10:01 AM
#1
Thread Starter
Addicted Member
null reference error??? help please
hey guys
I am getting the error
An unhandled exception of type 'System.NullReferenceException' occurred in Testharness.exe
Additional information: Object reference not set to an instance of an object.
--------------------------------------------------------
namespace AdaptorPropertyNamespace
{
public class AdaptorProperty
{
public string propertyName;
public string propertyStringValue;
}
}
---------------------------------------------------------
AdaptorProperty[] properties = new AdaptorProperty[2];
properties[0].propertyName = "title";
----------------------------------------------------------
why does my program break out at 'properties[0].propertyName = "title";' with a null reference error?
thanx in advance
-
Aug 23rd, 2006, 10:57 AM
#2
Re: null reference error??? help please
Code:
AdaptorProperty[] properites = new AdaptorProperty[2];
properites[0] = new AdaptorProperty();
properites[0].propertyName = "TITLE";
Because you'd declared the arrays, but not the objects themselves.
-
Aug 23rd, 2006, 10:58 AM
#3
Re: null reference error??? help please
Sorry about the spelling.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|