Right now I'm making a game in C# but also using a database for registering and logging in.
I was wondering if there was a better way to check log in credentials and see if a username / email address has been already taken via registering with another member. Right now I'm just reading all of the database rows (Username & Email) and making them a lower case string and comparing it to the Email address inputted as well as the Username. Both email and username from the database as well as the inputted information have been converted to a lower cased string.

Is there a better way to check the database for certain information rather than running through all of it to check?

Please do not move this thread to public. I posted it in the team section for a specific reason.