I'm having some real issues with handling a null reference when checking my database for a username and password on the below code.
If the username and password match it works, but if it doesn't or the username + password textboxes are empty it throws a null execption?
How can I handle the null on the below?
if (strResult.Length == 0)
{
label1.Text = "INCORRECT USER/PASS!";
}
else
{
label1.Text = "YOU ARE LOGGED IN!";
}
}
Handle null on checking DB
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Aug 25, 2011, 9:27 AM EDT
mike DelvottiRank #7,298 · 244 reputationPosted Aug 25, 2011, 11:23 PM EDT