i'm enable to find Ssl Enable option in my VS 2015 professional So how it is possible to solve “local host deos not support Ssl conncetion” error
i'm enable to find Ssl Enable option in my VS 2015 professional So how it is possible to solve “local host deos not support Ssl conncetion” error
The problem is that i'm using VS 2015 professional.I visited a couple of blog to enable Ssl Connection But i'm enable to find the option in my VS.I'm a beginner not much understanding of code Here is my all code .... Please anybody make it working
1) An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException'
occurred in MySql.Data.dll
2) Additional information: The host localhost does not support SSL connections.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace UCETRA02
{
public partial class Form1 : Form
{ //Global variable
private MySqlConnection ObjConnection;
private string server, database, uid, password;
//intialize connection
private void InitializeConnection()
{
server = "localhost";
database = "table";
uid = "root";
password = "";
string connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
ObjConnection = new MySqlConnection(connectionString);
}
//Open Connection
private bool OpenConnection()
{
try
{
ObjConnection.Open();
return true;
}
catch (MySqlException ex)
{
switch (ex.Number)
{
case 0:
MessageBox.Show("Can not connect to server");
break;
case 1045:
MessageBox.Show("Invalid User name/Password");
break;
}
return false;
}
}
//Close Connection
private bool CloseConnection()
{
try
{
ObjConnection.Close();
return true;
}
catch (MySqlException ex)
{
MessageBox.Show(ex.Message);
return false;
}
}
private void button1_Click_1(object sender, EventArgs e)
{
if (txtid.Text == "" || txtName.Text == "" || txtMobile.Text == "")
{
MessageBox.Show("Please Enter all of your detail.", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
else
{
string query = "INSERT INTO tablemm (id,Name,MobileNo) VALUES ('" + txtid.Text + "','" + txtName.Text + "'.'" + txtMobile.Text + "')";
OpenConnection();
MySqlCommand ObjCommand = new MySqlCommand(query, ObjConnection);
ObjCommand.Connection.Open(); // wallah
ObjCommand.ExecuteNonQuery();
this.CloseConnection();
}
}
public Form1()
{
InitializeComponent();
InitializeConnection();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Possible duplicate of MySql.Data.MySqlClient.MySqlException: “The host localhost does not support SSL connections.”
– mjwills
Jul 2 at 2:35
server={0};user id={1};password={2};persistsecurityinfo=True;port={3};database={4};SslMode=none
– imzia99
Jul 2 at 6:12
string connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";SslMode=none";– mjwills
Jul 2 at 6:13
string connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";SslMode=none";
well it helps . But still SSL connection prob
– imzia99
Jul 2 at 7:19
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
the error are at the button1_Click in else statement ObjCommand.Connection.Open();
– imzia99
Jul 2 at 2:30