Im working on a SQL database project in C#. I'm looking to create a login form which will be presented when someone starts the application.
The connection is made to the database, however they must enter a correct username and password into the first form before they can proceed to see the rest.
I have created 2 text boxes, and a button txtusername and txtpassword and a button login.
Here is my SQL command:
SqlCommand command = new SqlCommand("SELECT * FROM tblUsers WHERE Username ='" + txtUsername + "' AND Password = '" + txtPassword + "'", Program.cs);
I'm looking for a way to show in a label if the sql command yields a result meaning the username and password is stored in the user table then it returns true or something. If there is a more efficient or effective way to this also let me know :).