// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data; using MySql.Data.MySqlClient; class MainClass { public static void Main(string[] args) { MySqlConnection con = new MySqlConnection("Database=Test;Data Source=localhost;User Id=root;Password="); con.Open(); MySqlCommand sel = new MySqlCommand("SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='Test'", con); MySqlDataReader rdr = sel.ExecuteReader(); while(rdr.Read()) { Console.WriteLine(rdr[0] + " " + rdr[1]); } rdr.Close(); con.Close(); } }