Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int? CheckUserPass()
- {
- // take text boxes
- // user and pass
- // go into db
- // get matching userid
- var matchedUser = from userRow
- in dc.Users
- where userRow.UserName == txtUsername.Text &&
- userRow.Password == txtPassword.Text
- select userRow.UserID;
- if (matchedUser.Any())
- return matchedUser.Single();
- else
- {
- MessageBox.Show("Invalid user or pass");
- // focus clear etc
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement