title: check the manual that corresponds to your mariadb server version for the right syntax to use near "user" at line 1
body: <p>I have a textbox, button, and datagridview in my form. When i click the button, system will grab a table depending on my textbox from the database and show on datagridview. </p>
  
  <p>I getting this error when i click the button. Where am I wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/zx4GX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zx4GX.png" alt="error msg"></a></p>
  
  <p>here is my dbconn</p>
  
  <pre><code>Module mod_dbconn
  Public conn As MySqlConnection
  Public Sub openDB()
      Dim dbname As String = scr_sales.btn_dbswitch.Text
      Dim server As String = "localhost"
      Dim user As String = "root"
      Dim password As String = ""
  
      Try
          conn = New MySqlConnection
          conn.ConnectionString = String.Format("server={0}; user id={1}; password={2}; database={3}; pooling=false", server, user, password, dbname)
  
          If conn.State = ConnectionState.Closed Then
              conn.Open()
          End If
  
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Sub
  </code></pre>
  
  <p>This is my form</p>
  
  <pre><code>Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      Dim query As String = "SELECT * FROM '" + TextBox1.Text + "'"
      Dim cmd As New MySqlCommand(query, conn)
      Dim da As New MySqlDataAdapter(cmd)
      Dim dt = New DataTable
      Dim cb As MySqlCommandBuilder
  
  
  
      cb = New MySqlCommandBuilder(da)
      DataGridView1.Refresh()
  
      Try
          conn.Open()
          da.Fill(dt)
  
          Dim bsource As New BindingSource
          bsource.DataSource = dt
  
          Me.DataGridView1.DataSource = bsource
          da.Update(dt)
  
          conn.Close()
      Catch ex As Exception
          MessageBox.Show(ex.Message)
      Finally
          conn.Dispose()
      End Try
  End Sub
  </code></pre>