Click here to Skip to main content
15,909,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I am using Visual Studio 2010 and I don't know what's wrong. I got an error that says - "Object reference not set to an instance of an object".

The error shouldn't be there because I think I instantiated the object.

Please check my codes below:

Line:565   Dim Roles As New RolesFunctions

Line:566   If LCase(sLoginType) = LCase("admin") Then
Line:567      Call Roles.GetAdminRoles(nCompanyId, sStudentId)

...

The error is pointing at line 567, says - "Object reference not set to an instance of an object".

The RolesFunctions is a Public Class where the GetAdminRoles method is located.

Do I missed something in the codes?

Thanks,

Hifiger
Posted
Updated 26-Sep-10 22:55pm
v2

1 solution

Debug the code first

Check the Lines 566,567

Put the breakpoint in Line No 566

Make sure you can get the value for sLoginType before the line executed. If not you should change code.

Also check the value for sStudentId
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900