Hi,
This is probably a very basic problem.
I have written a piece of code in Ado.net on my PC to read data from a mysql table on my laptop.
They are connected via a router.(PC connected by ethernet and laptop by WAN).
However the code throws an exception.
Host 'ADMINISTRATOR' is not allowed to connect to this MySQL server.
connection string that i used is
"server=192.168.1.5;User Id=root;Password=***;database=test1"
private void Form1_Load(object sender, EventArgs e)
{
MySqlConnection conn = new MySqlConnection(
"server=192.168.1.5;User Id=root;Password=***;database=test1");
MySqlDataAdapter dataAdapter
= new MySqlDat-aAdapter("select * from student_information", conn);
DataSet dsStudents = new DataSet();
dataAdapter.Fill(dsStudents,"student_information");
dataGridView1.DataSource = dsStudents.Tables[0];
}
When i access a table on my PC then such code works.
My laptop's ip add is 192.168.1.5.
I have never dealt in client server stuff before. Pls guide me.
Thanks :)
This is probably a very basic problem.
I have written a piece of code in Ado.net on my PC to read data from a mysql table on my laptop.
They are connected via a router.(PC connected by ethernet and laptop by WAN).
However the code throws an exception.
Host 'ADMINISTRATOR' is not allowed to connect to this MySQL server.
connection string that i used is
"server=192.168.1.5;User Id=root;Password=***;database=test1"
private void Form1_Load(object sender, EventArgs e)
{
MySqlConnection conn = new MySqlConnection(
"server=192.168.1.5;User Id=root;Password=***;database=test1");
MySqlDataAdapter dataAdapter
= new MySqlDat-aAdapter("select * from student_information", conn);
DataSet dsStudents = new DataSet();
dataAdapter.Fill(dsStudents,"student_information");
dataGridView1.DataSource = dsStudents.Tables[0];
}
When i access a table on my PC then such code works.
My laptop's ip add is 192.168.1.5.
I have never dealt in client server stuff before. Pls guide me.
Thanks :)