Imports MySql.Data.MySqlClient
Public Class Form1
    Public Sub New()
        InitializeComponent()
        Dim conn = New MySqlConnection
        conn.ConnectionString = "server=127.0.0.1;" _
          & "user id=root;password=;database=mysql"
        Dim cmd As New MySqlCommand
        Dim adt As New MySqlDataAdapter
        Dim mydata As New DataTable
        Dim sql As String = "select name,time_zone_id from time_zone_name"
        conn.Open()
        Try
            cmd.Connection = conn
            cmd.CommandText = sql
            adt.SelectCommand = cmd
            adt.Fill(mydata)
            DataGridView1.DataSource = mydata
        Catch myerror As MySqlException
            MsgBox("error: " & myerror.Message)
        End Try
        conn.Close()
    End Sub
End Class
