troubleshooting Question

How to use this class - Error 1

Avatar of narmi2
narmi2 asked on
.NET ProgrammingVisual Basic.NETASP.NET
6 Comments1 Solution427 ViewsLast Modified:
Dear Experts,

Continuing from here:
https://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/Q_24795491.html

I have tried to compile the current code, and have received the following error:

NullReferenceException was unhandled by user code

The error happened on here on the second line

        Dim PSP(0) As ProfileSearchParameter
        PSP(0).AttributeID = imProfileAttributeID.imProfileAccessTime
        PSP(0).SearchValue = "test"

Just as a reminder, I am trying to implement this class:

public class SearchDocumentsInput
{
public string[] Databases;
public imProfileAttributeID[] OutputProfile;
public ProfileSearchParameter[] ProfileSearchParameters;
public imSearchEmail SearchEmail;
public FullTextSearch FullTextSearch;
public OutputMask OutputMask;
}

The the part I am having the error with is

public ProfileSearchParameter[] ProfileSearchParameters;

Which is the following class

public class ProfileSearchParameter
{
public imProfileAttributeID AttributeID;
public string SearchValue;
}

and imProfileAttributeID is an enum.

Can anyone please help?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros