TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mike Delvotti
NA
262
0
Handle null on checking DB
Aug 25 2011 1:13 PM
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!";
}
}
Reply
Answers (
2
)
Linear Programming In C#
C#NET2008 Window Application using Microsoft WORD 2003