Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

problem in accessing data from a different m/c on LAN (no replies)

$
0
0
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 :)

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>