Yeah, it has something wrong with it... It's pretty open to SQL injection.
Whenever a user enters a name like this:
Name: ' OR 1=1 --
Password:
you end up with this query:
SELECT UserID, Username, Password FROM tblUsers WHERE Username = '' OR 1=1 --' AND Password = '" + TextBox2.Text
which means the user can log in with the first available account which is often the admin becuase it's the account you create first.
You may want to Google a bit for SQL injection and read this whitepaper:
http://www.nextgenss.com/papers/adva..._injection.pdf
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.