I am working in an environment where out database is MySQL and we access via C# & ASP.Net front end. I am providing you few codes hoping that you will understand.
I assume that you already have the necessary compatible MySQL deliverables(dlls) files for your .Net application.
using MySql;
using MySql.Data;
using MySql.Data.MySqlClient;
private void button2_Click(object sender, EventArgs e)
{
string str_user_entered_id=txtuser.text;
string str_user_entered_pass=txtpass.text;
MySqlConnection conn = new MySqlConnection("Database=zzzz_live;Data Source=eu;User Id=yyyy;Password=xxxx");
conn.Open();
MySqlCommand comm;
MySqlDataReader reader;
qry = "SELECT ref_no,user_ID,pass FROM `zzzz_live`.`table_name`";
comm = new MySqlCommand(qry, conn);
reader = comm.ExecuteReader();
while (reader.Read())
{
string user_id=reader[1];
string user_pass=reader[2];
if(user_id.equal(str_user_entered_id) && user_pass.equals(str_user_entered_pass))
{
}
}
}
Try this code.. If you get any errors please comment here.
Thanks