Normal My sql Database connection code:
private void button2_Click(object sender, EventArgs e)
{
// mysql server connection
connString = "SERVER= localhost;PORT=3306;DATABASE=pelista_db;UID=root;PASSWORD=;";
try
{
conn = new MySqlConnection();
conn.ConnectionString = connString;
conn.Open();
MessageBox.Show("Connection is Success");
}
catch(MySqlException ex)
{
MessageBox.Show(ex.Message);
}
}
Solved My sql Database connection code:
private void button2_Click(object sender, EventArgs e)
{
// mysql server connection
connString = "SERVER= localhost;PORT=3306;DATABASE=pelista_db;UID=root;PASSWORD=; SSL Mode=None";
try
{
conn = new MySqlConnection();
conn.ConnectionString = connString;
conn.Open();
MessageBox.Show("Connection is Success");
}
catch(MySqlException ex)
{
MessageBox.Show(ex.Message);
}
}
0 Comments