Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Error with linq - validating text value with database

$
0
0

Hey Peeps,

(1) Not sure why I get the message that my if statement 'is a value of type 'int' that is always true - even though Email is char.

(2) There's an error, 'value cannot be null' even though i did supply a value to my textbox. Any suggestions how to fix my issues?

Male maleLogin = new Male();

                    var authenticateUserEmail = (from userEmail in maleLogin.Email
                                                 where txtEmail.Text == userEmail.ToString()
                                                 select userEmail).SingleOrDefault();

                    if (authenticateUserEmail != null)
                    {
                        lblResult.Text = authenticateUserEmail.ToString();
                    }
                    else
                    {
                        lblResult.Text = "No Email Address Found";
                    }




Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>