title: display a mysql db table into datagridview in vb.net
body: <p>I am working on this project and I want to display the content of a MySQL table in a datagridview in VB.NET.</p>
  
  <p>The query for the retrieving the table works fine but when I run the program it doesn't display any data in the table shown.</p>
  
  <p>The code I am using:</p>
  
  <pre><code>Private Sub Products_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      SearchTextBox.Enabled = False
      Label1.Enabled = False
  
      SqlConn = New MySqlConnection
      SqlConn.ConnectionString = "Server=localhost;userid=root;password=;database=osap"
      Dim data As MySqlDataAdapter
  
      Try
          SqlConn.Open()
          data = New MySqlDataAdapter("SELECT products.id, inventory, description, products.name, categories.name as category, price FROM products INNER JOIN branches ON products.branch_id = branches.id INNER JOIN categories ON products.category_id = categories.id WHERE branch_id ='" &amp; LoginForm.BranchIDTextBox.Text &amp; "' ", SqlConn)
          productstable = New DataTable
          data.Fill(productstable)
  
          ProductsDataGridView.DataSource = productstable
          ProductsDataGridView.ReadOnly = True
          SqlConn.Close()
  
      Catch ex As Exception
          MessageBox.Show(ex.Message)
  
      Finally
          SqlConn.Dispose()
      End Try
  
  End Sub
  </code></pre>
  
  <p>Why am I not getting any results in the DataGridView?</p>