title: How to solve the error message comes in vb.net mysql?
body: <p>I have an error when try to execute the following code.</p>
  <p>The error is = &quot;<strong>The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception</strong>&quot;.</p>
  <p>I use Visual Studio 2019 &amp; MySQL Server 5.7.
  Help me to solve this error &amp; thanks in advance.</p>
  <pre><code>Private Sub BtnEnter_Click(sender As Object, e As EventArgs) Handles BtnEnter.Click
      Dim server, user, password As String
      server = EdtServer.Text
      user = EdtUser.Text
      password = EdtPassword.Text
  
      Dim msb As MySqlConnectionStringBuilder = New MySqlConnectionStringBuilder
      msb.Server = server
      msb.Port = 3306
      msb.UserID = user
      msb.Password = password
      msb.Database = &quot;test&quot;
  
      Dim Con As MySqlConnection = New MySqlConnection(msb.ConnectionString)
  
      Try
          Con.Open()
          If (Con.State = ConnectionState.Open) Then
              MsgBox(&quot;Success !&quot;, MsgBoxStyle.Information)
          Else
              MsgBox(&quot;UnSuccess !!&quot;, MsgBoxStyle.Information)
          End If
      Catch ex As Exception
          MsgBox(ex.Message, MsgBoxStyle.Critical)
      End Try
  End Sub
  </code></pre>