Originariamente inviato da spider81man
Scusami come posso fare??
Ho provato sul libro ma non mi da un esempio che risco a capire
Io farei:
codice:
Dim connStr
            connStr = String.Format("server=localhost;user id=root; password=;database=test;")
            conn = New MySqlConnection(connStr)
            conn.Open()
            Dim cmd As New MySqlCommand("SHOW DATABASES", conn)
            Dim m_reader As MySqlDataReader
            m_reader = Nothing
            cmd.CommandText = "SELECT * FROM magazzino"
            m_reader = cmd.ExecuteReader()
If m_reader.HasRows() = true then
            While m_reader.Read()
                conte_bottone = conte_bottone + 1
                MsgBox(m_reader.GetString(2))
                bottone.Location = New System.Drawing.Point(280, 272)
                bottone.Text = m_reader.GetString(2)
                Controls.Add(bottone)
            End While
else
' Nessun record risultante
end if