title: Code behide VB.connection string?
body: <p>I am currently developing a webpage using <code>ASP.NET</code> with <code>VB</code> as back end. But I am facing a problem. I don't know how to make a database connection to connect with <code>MYSQL WORKBENCH</code>. I just wrote the connection but it just code for <code>SQL server</code>. </p>
  
  <p>This is my sample code for connection but it for <code>sql server</code>. I just want code for <code>mySQL</code> workbench.</p>
  
  <pre><code>Imports System.Data
  Imports System.Data.SqlClient
  
    Partial Class Request
        Inherits System.Web.UI.Page
  
        Dim con As New SqlConnection
        Dim cmd As New SqlCommand
  
  Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        txt1.Focus()
        txt2.Focus()
        txt3.Focus()
        txt4.Focus()
        txt5.Focus()
        txt6.Focus()
        txt7.Focus()
        ddl1.Focus()
        ddl2.Focus()
        ddl3.Focus()
        ddl4.Focus()
  End Sub
  
  Protected Sub btnsubmit_Click(sender As Object, e As EventArgs) Handles btnsubmit.Click
      con.ConnectionString = "Server=localhost;Database=test;Uid=root;Pwd=1234;"
  
      con.Open()
  
      cmd.Connection = con
      cmd.CommandText = "INSERT INTO cr_record (Emplid, Nama, date, DeptDesc, email, Change, reasonchange,problem,priority,reasondescription,systemrequest) VALUES  (@Emplid, @Nama, @date, @DeptDesc, @email, @Change, @reasonchange,@problem,@priority,@reasondescription,@systemrequest)"
  
      cmd.Parameters.AddWithValue("@Emplid", ddl1.Text)
      cmd.Parameters.AddWithValue("@Nama", TextBox1.Text)
      cmd.Parameters.AddWithValue("@date", txt5.Text)
      cmd.Parameters.AddWithValue("@DeptDesc", txt2.Text)
      cmd.Parameters.AddWithValue("@email", txt4.Text)
      cmd.Parameters.AddWithValue("@Change", ddl2.Text)
      cmd.Parameters.AddWithValue("@reasonchange", txt6.Text)
      cmd.Parameters.AddWithValue("@problem", ddl3.Text)
      cmd.Parameters.AddWithValue("@priority", rbl1.Text)
      cmd.Parameters.AddWithValue("@reasondescription", txt7.Text)
      cmd.Parameters.AddWithValue("@systemrequest", ddl4.Text)
      cmd.ExecuteNonQuery()
  
      con.Close()
  
      MsgBox("Added Successfully")
  End Sub
  </code></pre>
  
  <p>End Class</p>