Callback(Object sender, EventArgs e) +35 EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 _Load(Object sender, EventArgs e) in C:\SchindlersList\Schindler\Schindler\:25 Create(MySqlConnectionStringBuilder settings) +163 Source File: C:\SchindlersList\Schindler\Schindler\ Line: 25 Line 27: msqlReader = msqlCommand.ExecuteReader() Line 26: //use a DataReader to process each record Line 23: msqlCommand.CommandText = “SELECT * FROM ball ”
I used your sample code above to simulate the error and here is the exception. I’m getting the same problem as MaryamKh, and was wondering if you could help. I’m able to ping the server IP addresses (it has two) from my machine so I know it can be reached.Īlso the connection information (ip, username, password) are correct because an older applicaion is able to connect using the same information. If I enter the database name manually and click the Test Connection button I get an error “Unable to connect to any of the specified MySQL Hosts”. If I enter all the information and then try to select the database name from the dropdown list I get an error “Unable to retrieve the list of databases”. In VS2010 I followed the procedure you mentioned in this article but I still cannot connect to the server. So I need to connect using the IP address, user id, and password. I’m developing on another machine but will have to publish the website to the server i mentioned. My website has to connect to a mysql database on this server.
I’m constrained to use this framework and not install a new one. I have to develop a website for a server which has. msqlReader = msqlCommand.ExecuteReader() use a DataReader to process each record MsqlCommand.CommandText = "SELECT * FROM TestTable " MsqlCommand.Connection = this.msqlConnection define the connection used by the command object MsqlConnection = new (“server=localhost user id=UserName Password=UserPassword database=DatabaseName persist security info=False”) If you want to connect to a MySql database from a C# application (Windows or Web) you can use the next sequence: //define the connection reference and initialize it
This problem has another solution: How to deploy. So solving this problem you could not install the application on Windows XP because it will not find the required connector. In my case I could not install the connector (the installation wizard failed). But this version has another problem.The MySQL connector does not work on Windows XP, only on Windows 7. The problem seems that has been solved with the release of the MySql Connector/Net 6.3.4.
The same problem has been reported also for the MySql Connector/Net 6.2.2. This is a compatibility problem between VS2010 and MySQL connector.
There were no problems compiling the project, just VS2010 could not see the connector when trying to create a new Data connection. Also when trying to add the data connection, in the Choose Data Source window it does not show the MySQL Database.The MySQL connector (an older version – 5.2.7.0) was installed and the reference to MySql.Data namespace was added. The application connects to a MySQL database and after porting it to VS2010, the IDE does not show the connection to the MySQL in Server Explorer. I have developed a Windows Application in Visual Studio 2008 some years ago and now it has been updated in Visual Studio 2010.