problem in accessing MYSQL using C#

lokmannicholas

New member
Joined
Dec 16, 2011
Messages
1
mySqlConnection Mysql = new mySqlConnection(host, database, user, password);

i type my domain name as the host and
i have also try typing the IP address as well,
but it cannot be connected. Does anyone know how to connect a server by using C# programming??
 
Most likely your host does not have the mysql port (3306) opened to the public. Perhaps it is firewalled or your username isn't allowed access except from localhost. I would try using a tool like Toad for MySQL or Sequel Pro to access the database first. If/when you get that working, then concentrate on your C# application.
 
Mysql c#

mySqlConnection Mysql = new mySqlConnection(host, database, user, password);

i type my domain name as the host and
i have also try typing the IP address as well,
but it cannot be connected. Does anyone know how to connect a server by using C# programming??

try the following code

connectionString = "SERVER=" + server + ";" + "DATABASE=" +
database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

connection = new MySqlConnection(connectionString);


http://csharp.net-informations.com/data-providers/csharp-odbc-connection.htm

nelson.
 
Back
Top