if ((UserName == Dr["username"].ToString()) & (Password == Dr["Password"].ToString()))
improper syntax. Needs two && signs; No capital P in your select statement.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
moreover, you should not grab every record in the users DB. Instead, grab the record that pertains to you:
SELECT password FROM Users WHERE username=@username
command.parameters.addwithvalue("@username, UserName)
DR = command.ExecuteReader()
...
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68