Monday, June 21, 2004

.Stories of a .NET Newbie (5)

Today there was another of these learning moments. I have this Public Class where I store all my global business related code. Now what I did was defining my first Public Function CheckCredentials(ByVal username As String, ByVal hPassword As String) which, AFAIK, can easily be called by:

CheckCredentials (txtUsername.Value, hPassword)

However, running the code produced another runtime error

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

I took me awhile to find the origin of the error. This was mostly due to the fact that I thought the function was called with the right parameters. After some testing I realized the function needed to be shared, e.g. make it Public Shared Function

Somehow, one hopes that troubleshooting with in the end become easier, after one has done his fair share of it. But it turns out every time that there's always a new error to be learned from