title: Unable to create a connection between Visual Studio 2010 amd MySQL
body: <p>I have been trying to connect visual studio and mysql for a while now but have failed.
  On executing the following code, I am getting this error: <strong>error BC30311: Value of type 'MySql.Data.MySqlClient.MySqlConnection' cannot be converted to 'System.Data.SqlClient.SqlConnection'.</strong></p>
  
  <pre><code>Imports MySql.Data.MySqlClient
  Imports System.Data.SqlClient
  Imports System.Data
  Imports System.Windows.Forms
  
  Partial Class AddStock
  Inherits System.Web.UI.Page
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
      Dim cmd As New SqlCommand
  
      Dim conn As New MySql.Data.MySqlClient.MySqlConnection
      Dim myConnectionString As String
  
      myConnectionString = "server=127.0.0.1;" _
                  &amp; "uid=root;" _
                  &amp; "pwd=12345;" _
                  &amp; "database=test;"
  
      Try
          conn.ConnectionString = myConnectionString
          conn.Open()
          cmd = New SqlCommand("insert into records ([p_id], [pname], [powner], [quantity], [threshold], [e_id]) values ('" &amp; TextBox2.Text &amp; "','" &amp; TextBox3.Text &amp; "','" &amp; TextBox4.Text &amp; "','" &amp; TextBox5.Text &amp; "','" &amp; TextBox6.Text &amp; "','" &amp; TextBox1.Text &amp; "')", conn)
  
          cmd.ExecuteNonQuery()
          MessageBox.Show("Succesfully Inserted")
  
      Catch ex As MySql.Data.MySqlClient.MySqlException
          MessageBox.Show(ex.Message)
      Finally
          conn.Close()
      End Try
  End Sub
  
  End Class
  </code></pre>