title: how can i fix my database Connection in vb.net?
body: <pre><code>    Imports MySql.Data.MySqlClient
      Imports MySql.Data
      Public Class Form1
      Dim dbcon As New MySqlConnection("Data Source=VINCENT-PC\SQLEXPRESS;Initial Catalog=Group1;Integrated Security=True")
      Dim sqlcmd As String
      Dim mysqlcmd As MySqlCommand
      Dim dr As MySqlDataReader
  
  Private Sub btnSearch_Click(sender As System.Object, e As System.EventArgs) Handles btnSearch.Click
      Try
          sqlcmd = "Select * from Sample1 where num=" + txtname.Text
          mysqlcmd = New MySqlCommand(sqlcmd, dbcon)
          dbcon.Open()
          dr = mysqlcmd.ExecuteReader
          While dr.Read
              txtfname = dr.Item("fname")
              txtlname = dr.Item("lname")
          End While
          dr.Close()
          dbcon.Close()
      Catch ex As Exception
          MsgBox("Error: " &amp; vbCrLf &amp; vbCrLf &amp; vbCrLf &amp; ex.Message)
      End Try
  End Sub
      End Class
  </code></pre>
  
  <p>this is the code that i wrote but it seemed like it doesn't connect to my database please help me and thank you in advance</p>