Re: MySQL Workbench unable to connect to MySQL Server
Hi Mike
Thank you, I've now got the server running.
But how can I tell if my C# web application is connected to it?
This is my connection string code;
string connString = "server=Localhost;port=3306;database=OnlineTestingDatabase;user=root;password=****;";
MySqlConnection conn = new MySqlConnection(connString);
And I've made a method called AmIConnectedToDB to test the connection;
MySqlConnection myConnection = GetConnection2();
string check = "";
try
{
myConnection.Open();
Console.WriteLine("MySQL version: " + myConnection.ServerVersion);
check = "MySQL version: " + myConnection.ServerVersion;
}
catch (Exception ex)......
Then connected this method to a button on the home page, but it does nothing when I click it, the page just reloads to how it was.
Do you have any ideas?
Sorry if this is no longer an MySQL problem
And also is it possible to have the actual MySQL Database file referred to as a source in the c# code? As I need to be able to zip the database file up along with the web application project folder and to work on someone elses computer.
Many thanks
Subject
Views
Written By
Posted
1357
November 23, 2014 01:47PM
709
November 24, 2014 02:13AM
Re: MySQL Workbench unable to connect to MySQL Server
705
November 24, 2014 04:23AM
566
November 25, 2014 02:08AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.