i just watching yt (https://www.youtube.com/watch?v=wIlfXT5DzyI) and his code works fine,but mine says it has error: MySql.Data.MySqlClient.MySqlException: ‘Table ‘bpsu.users’ doesn’t exist’.
why i have this problem? i just follow his instructions (im sorry im newbie)
this is my code that is similar to the tutorial: `private void button1_Click(object sender, EventArgs e)
{
string mysqlcon = "server=127.0.0.1; user=root; database=bpsu; password=";
MySqlConnection con = new MySqlConnection(mysqlcon);
string username = txtboxUser.Text.ToString();
string password = txtboxPass.Text.ToString();
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
{
MessageBox.Show("no empty fields allowed");
}
else
{
con.Open();
MySqlCommand mysqlcmd = new MySqlCommand("select * from users", con);
MySqlDataReader mysqlread = mysqlcmd.ExecuteReader();
while (mysqlread.Read())
{
if (username.Equals(mysqlread.GetString("username")) && password.Equals(mysqlread.GetString("password")))
{
MessageBox.Show("Login Successfully");
}
else
{
MessageBox.Show("Invalid Login");
}
}
con.Close();
}
}
}
}`
New contributor
Stanley Markson Verian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.