This tutorial will teach you how to do the login from validation using C#.net and Sqlserver. Import the Namespaces using System.Data.SqlClient; Establish the Database Connection SqlConnection con = new SqlConnection(“server=.;database=StarAirways;user id=sa;password=123;”); Add Button SqlCommand cmd = new SqlCommand("select username,password,role from users where username='" + txtUserName.Text + "' and password='" + txtPassword.Text + "'and role='" + CRole.Text + "'", con); SqlParameter …