I have created a database in mysql(smcofchristlogin)and
a table called "login" with fields (username,password).
In my aspx page I created two textboxes(username, password) also I have a imagebutton called "logon"
Note : I am not using the Login controls in asp.net.
So how to create a login page in such a way that when I press the logon button, the program can go to my database and check if the values from the textboxes are the same value from my table (username and password).
If there are not , write a message "You are not authorized to see this page" , by the way this is an asp label.
I am using C# server side and Mysql
Thanks for your help
protected void Logon_Click(object sender, ImageClickEventArgs e)
string host = "localhost";
string database = "smcofchristlogin";
string user = "root";
string password = "";
string strSQL = "SELECT * FROM login";
string strProvider = "Data Source=" + host + ";Database=" + database + ";User ID=" + user + ";Password=" + password;
MySqlConnection mysqlCon = new MySqlConnection(strProvider);
if (mysqlCon.State.ToString() == "Open")
MySqlCommand mysqlCmd = new MySqlCommand(strSQL, mysqlCon);
MySqlDataReader mysqlReader = mysqlCmd.ExecuteReader();