I use a function that returns a dataset, if I don't have enough information from the user I return 'nothing' from the fuction. So back in my code I am checking if the returned dataset=nothing. That is when I get a NullReferenceException.
'this is the code for checking for an empty dataset
If GlobalInfoReturn1.Tables(0).Rows.Count = 0 Then
MessageLabel.Text = "Make sure you have filled out all fields correctly"
Do something else