Basic Question. This is login functionality of any project.
you can customize you code or use readymade controls of asp.net. check out,
ASP.NET login controls[
^]
Before storing your username and password to database you can encrypt with different security algorithms. Use a cryptographically secure random number generator.
you can take help of this article.
The Art & Science of Storing Passwords[
^]