' Dim MysqlConn As MySqlConnection Dim ContactsCommand As New MySqlCommand Dim ContactsAdapter As New MySqlDataAdapter Dim ContactsData As New DataTable Dim SQL As String MysqlConn = New MySqlConnection() ' Define the SQL to grab data from table. SQL = "SELECT * FROM Contacts" 'Connection String MysqlConn.ConnectionString = "Server=****; Port=****; Database=***; Uid=*****; Pwd=****;" ' Try, Catch, Finally Try MysqlConn.Open() ' <<< L'exeption ce produit sur cette ligne ('MySql.Data.MySqlClient.Replication.ReplicationManager') ContactsCommand.Connection = MysqlConn ContactsCommand.CommandText = SQL ContactsAdapter.SelectCommand = ContactsCommand ContactsAdapter.Fill(ContactsData) DataGridView1.DataSource = ContactsData Catch myerror As MySqlException MessageBox.Show("Cannot connect to database: " & myerror.Message) Finally MysqlConn.Close() MysqlConn.Dispose() End Try '
10 janv. 2018 à 20:40