I created an application on OpenShift, everything is working and there are no problems. I now need to attach the database that is on OpenShift with my desktop application developed in C #. The desktop application only needs to read the data that we have within the database tables and nothing else. On the net I found no tutorial related to OpenShift and so I ask here if anyone has had experience in this regard.
The connection to the application of OpenShift is performative as a key complementary and do not know if this can create problems. Can someone show me a simple example?
I know does not provide aid of this kind, but I just want to figure out how to connect my desktop application to the online database hosted on OpenShift and nothing else, how could I do?
string connStr = @"Server=test-lound.rhcloud.com;Port=8000;Database=test;Uid=adminxxJ;Pwd=FxxxBdL;";
MySqlConnection conn = new MySqlConnection(connStr);
try
{
Console.WriteLine("Connecting to MySQL...");
conn.Open();
Console.WriteLine("Connection successfull !");
conn.Close();
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Eccezione => " + ex.ToString());
}
Console.WriteLine("Done.");
on conn.Open() is returned this exception:
Eccezione => MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. in MySql.Data.MySqlClient.NativeDriver.Open() in MySql.Data.MySqlClient.Driver.Open() in MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) in MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() in MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() in MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() in MySql.Data.MySqlClient.MySqlPool.GetConnection() in MySql.Data.MySqlClient.MySqlConnection.Open()
User contributions licensed under CC BY-SA 3.0