I have a MVC project. I added MySql.data.dll file to my project. My localhost and mysql database is open. My database's name is proje
and table is hasta_bilgileri
.
I searched and tried too many solution but everytime I had different problems. What is the problem with my code? One of the last errors was
"Access denied for user root"
MySqlConnection con = new MySqlConnection("Server=localhost;Database=proje;Uid=root;password=123456;");
MySqlDataAdapter da = new MySqlDataAdapter("Select *From hasta_bilgileri", con);
DataSet table = new DataSet();
try
{
con.Open();
}
catch (Exception e)
{
Console.WriteLine(e);
}
da.Fill(table, "hasta_bilgileri");
con.Close();